High above Connecticut Avenue, in an elegant suite at his downtown law firm, John Ray is relaxed and ready to talk politics once more. After 12 years of yearning to be mayor, here sits a man out to revive his battered career.

"Anyone sitting around thinking they've heard the last from John Ray, stay tuned," he boasts gamely. "I've been a survivor all of my life."

But five months after the flop of his third and most formidable bid to lead the District, Ray is still wrestling with defeat. Some of his aides and friends say that losing to Sharon Pratt Dixon in the Democratic mayoral primary last September, when he seemed the sure bet to win for months, was a crushing blow that sent him into a self-imposed political hibernation and left him puzzled about his political future.

Only now is Ray, a veteran at-large member of the D.C. Council, vowing to flex his muscles again in local politics -- even while some doubt he will ever be mayor.

He has moved quickly to establish good relations with Dixon recently, has a full legislative agenda and is showing delight that one of his closest political allies, John A. Wilson (D), is the council's new chairman.

"There's no doubt in my mind the loss has been very tough on him," said Joslyn N. Williams, chairman of the District's Democratic Party. "But now he's clearly giving the appearance that he's ready to bounce back."

Williams said he believes Ray, after 12 years and three campaigns, has "come to peace" with the fact that he may never be mayor. "I think the perception in the city is that his time has come and passed," Williams said. "That may not be fair, but perception is often reality."

For most of last year's race, Ray seemed charmed. He had raised a record $1.1 million, three times as much as any rival candidate. He had a well-organized staff spread citywide. He had collected dozens of coveted endorsements and comfortably led every voter poll for months.

"I can't wait to be mayor," Ray said before the primary. "I'm cherishing the moment." It never came.

Even as the council reconvened last month, Ray revealed unusual flashes of anger that some of his colleagues blamed on bitterness at his second-place finish.

They point with surprise to a private council meeting recently in which Ray, long known as a soft-spoken, affable politician, launched a scathing attack against council member Charlene Drew Jarvis (D-Ward 4), who also ran for mayor.

At one point in his diatribe, after criticizing her views on furloughs for the council, Ray called Jarvis a "heifer."

He has been unapologetic about the remark ever since, and seems intent on increasing his scrutiny of Jarvis's council work. Council sources said Ray urged Wilson last month to remove Jarvis as the head of the council's powerful Economic Development Committee, but she applied enough pressure to hold on.

Jarvis finished third in the mayoral primary with more than 26,000 votes. Ray now cites her attacks, along with those lobbed by Democrat and former D.C. delegate Walter Fauntroy, as having a large role in creating voter doubt about his character.

Jarvis and Fauntroy routinely suggested that Ray, whose campaign treasury overflowed with contributions from wealthy white real estate developers, would be hostile to neighborhood interests and working-class blacks.

"I think an awful lot of voters have this one idea of 'John Ray, the guy born with a silver spoon,' " said Ray, who grew up dirt-poor in segregated south Georgia, but now counts many of the District's most prominent lawyers and businessmen as his friends.

"I didn't deflect those attacks well enough," he said. "People are even shocked now to hear that I belong to a Baptist church."

Ray noted one incident late in the mayoral campaign, at an event one night near his home in Northeast's Ward 5, as an example of the difficulty he had with his image. A community activist thanked him for attending the event, saying he was surprised to see him in that part of town. Ray said his house was only a few blocks away.

"You really live out here in Ward 5?" the activist replied. "Since when?"

"I think John was misunderstood in the campaign," said council member H.R. Crawford (D-Ward 7), who endorsed Ray. "He wound up being portrayed as a very cold individual."

The night Dixon scored a resounding upset primary victory, Ray stood before hundreds of his supporters at a lavish party and gave a concession speech that many said was remarkably gracious.

Dixon's surprise win, he said, should be a lesson for the city's youth to never give up, even against the worst odds.

Then Ray, a lawyer with Baker & Hostetler, practically dropped out of sight during the general election campaign, when Dixon coasted to victory against Republican Maurice T. Turner Jr., former D.C. police chief. Ray's political organization became dormant, and he was silent on his future.

Now, he appears to be shrugging off the defeat, and refuses to rule out anything in the future -- including another bid for mayor. "That's too far away to think about," he said. Ray's council seat is up for election next year.

He has reorganized his staff, and he returned this month to his work as chairman of the council's committee on consumer and regulatory affairs. His office has begun vigorously promoting his council agenda, which includes bills to expand long-term drug treatment, relieve hospitals of the enormous debts incurred by uninsured patients and provide paying jobs to prisoners while they serve their time.

Crawford said he expects Ray to play a much larger role in council affairs now because of his close relationship with Wilson, who intends to expand the legislature's power.

"The two Johns complement each other," Crawford said. "And I'm sure they will be working very closely on important legislation."

So close, in fact, that when Wilson moved to the chairman's seat, he appointed Ray chairman pro tempore and reassigned him to sit next to Wilson -- a clear symbol of Ray's new clout.

"The fact that John isn't sitting in the mayor's office doesn't mean he won't be pushing his issues," said Ronald Jessamy, a close friend of Ray's who helped lead his campaign. "I guarantee you won't find him hiding in any corner."