Days after the Ramada Inn episode of December 1988, Mayor Marion Barry, his friends and advisers made quick decisions about dealing with the ensuing publicity and criminal investigation -- decisions that now could determine Barry's fate in the cocaine and perjury case against him.

The Ramada episode is full of what-if's and what-could-have-been's for the mayor. Barry had visited Lewis at the downtown hotel at least four times during the week before Christmas, and serious questions were being raised by investigators and reporters about Barry's last trip there on Dec. 22.

The question for the mayor, his friend Charles Lewis and others in those first days in late 1988 and early 1989 was how to respond. Lewis, a former D.C. and Virgin Islands government employee, received the first subpoena to testify before a federal grand jury. Rejecting friends' and lawyers' advice, he testified without the advice of an attorney.

Then, in March in the Virgin Islands, he was arrested in an undercover FBI drug sting, and was convicted on those charges. When prosecutors then confronted him here with perjury charges from his grand jury testimony, Lewis decided to cooperate. James D. McWilliams, a D.C. public works employee who had been with Barry and Lewis at the Ramada, got the next subpoena. McWilliams refused to testify before the grand jury, and spent almost a year under FBI and D.C. police scrutiny. It was only this year that McWilliams decided to cooperate, after Barry was arrested in the FBI sting at the Vista Hotel. McWilliams's cooperation provided key corroboration for Lewis's allegations against the mayor. Barry received his subpoena in January 1989, as news reports about the Ramada affair persisted. Barry told his chief counsel, Herbert O. Reid Sr., that he'd done nothing wrong, said close Barry friends. Reid and Barry decided the mayor should testify before the grand jury, and, they thought, the testimony would resolve Barry's legal and public relations problems.

Just before he went to the grand jury, Barry retained criminal defense lawyer R. Kenneth Mundy. Although Mundy had a rule against allowing clients to testify in such situations, he decided to go along with the Barry-Reid strategy. Negotiating with prosecutors, Mundy limited the questioning of Barry to the subject of Lewis and the Ramada Inn.

It is that Barry testimony on January 19, 1989, that is the basis for the three felony perjury counts against the mayor, the most serious charges he faces. He is charged with lying when he testified that he didn't know Lewis was involved with drugs, and had neither given drugs to Lewis, nor received drugs from him.

The Ramada episode began Dec. 22, 1988, when D.C. police detectives planned to make an undercover drug purchase from Lewis at the hotel. The deal never came off because Barry was visiting Lewis.

The police started an internal investigation of why the detectives broke off their sting plans.

Police obtained a printout of local and long-distance calls made from Lewis's room, and as investigators started interrogating Barry's and Lewis's friends about the matter, every person involved had to do some quick thinking.

At the end of Friday's court session, John Olsen, a longtime friend of Lewis's, testified about how Lewis fled the Ramada on Dec. 23 for Olsen's Northern Virginia home. Olsen said that the phone rang "incessantly," and that Lewis told him that he was facing some hard decisions.

"He said, 'John, it is just something between me and the mayor, something is going down . . . and the ball is in my court,' " Olsen testified.

As it turned out, Lewis and McWilliams talked about getting lawyers in late 1988, according to sources familiar with the case, but decided they would take their chances going it alone against the investigators from the police Internal Affairs Division. After the first interviews over Christmas weekend in 1988, McWilliams, himself a lawyer, reconsidered his position.

This was a serious investigation, McWilliams decided after talking with police, not just a superficial attempt by one arm of the District government to check out yet another allegation that Barry was involved in drugs. A close friend of McWilliams's said that once McWilliams retained an attorney, the attorney's first actions were to upbraid McWilliams for going to the police alone and to warn him not to say anything without legal advice again.

In court last week, McWilliams said his decision not to testify was costly for him. The legal fees almost broke him, he said, and the media attention and police scrutiny kept him in a state of stress. He did not add that his approach, had it been adopted by Lewis and Barry, might have paralyzed the investigation.

McWilliams was so convinced in early January 1989 that he needed an attorney that he attempted to secure one for Lewis as well. In fact, according to a close friend, Lewis met with a lawyer on the day before he was scheduled to testify, but decided not to hire him. The lawyer is Mark Shaffer, who eventually came to represent Lewis here.

In his testimony before the grand jury in January 1989, Lewis denied smoking crack with Barry.

Lewis's Ramada Inn telephone records led police to Blake Harper, Sonny Watley and Mary Henry, Lewis's partners in a loose drug organization. Using stray statements from one against the other, investigators obtained enough information to seek drug charges against Lewis.

Had Lewis been working with a criminal lawyer, the attorney probably would have had the same telephone records, since such records are available to a hotel guest. A lawyer could have advised Lewis about his legal exposure. Sources familiar with the case said that although investigators were sure that Lewis was involved in drugs, U.S. Attorney Jay B. Stephens wanted more evidence.

For Lewis, the decision not to hire an attorney proved costly. There was no one to anticipate what was coming next: the undercover sting in Lewis's Virgin Islands hometown of St. Thomas.

Lewis has described the arrest by FBI agents in the Virgin Islands in March 1989 as "a wake-up call" that started him on the road to cooperation with the government.

For Barry, the decision to seek legal advice was already made. He had on his staff two lawyers, chief counsel Reid and Reid's assistant Marlene Johnson. Acting as Barry's attorneys, the two conducted an early informal investigation into the Ramada matter, interviewing McWilliams in the atrium of a Capitol Hill hotel, and seeking information about the detectives' aborted sting of Lewis.

According to sources close to Barry, the mayor assured Reid and Johnson that he had done nothing wrong at the Ramada, and he was certain Lewis and McWilliams would say that to investigators. After McWilliams told Reid that he had not seen the mayor with drugs at the Ramada, Reid came up with an idea for the mayor.

Publicity about the Ramada was not going away, despite Barry's public assertions that he had not used drugs. So Reid advised Barry that if he could truthfully testify that he had used no drugs at the Ramada, then he should do it, walk out of the courthouse and announce he had done it.

At the same time, Stephens's top criminal assistant, H. Marshal Jarrett, was extending an "invitation" to the mayor to testify before the grand jury, which later issued a subpoena to Barry. The letter, which has been released by prosecutors, makes clear that Barry was a subject of the probe. Following the advice of numerous close friends -- including some who've had legal problems of their own -- Barry sought a second opinion from criminal-defense specialist Mundy.

According to sources, Mundy told the mayor that he almost never advises a client to testify before the grand jury. But Barry and Reid insisted that it would be a good way to counter news accounts about the Ramada and about Lewis's role in the controversial D.C.-Virgin Islands personnel project.

Mundy said he would agree to go along with the plan to have Barry testify, but only if he could reach an agreement with Jarrett to limit the questioning to the issue of the Ramada episode. That agreement shows that Barry would answer questions about the Ramada and about Lewis. Another letter shows that Barry asserted his Fifth Amendment rights, declining to answer further questions about drugs.

As Barry's trial proceeds, the defense strategy has gradually become clear. Mundy is focusing his attention on beating the three felony counts of perjury that arose from Barry's testimony in January 1989. Without that testimony, there could be no perjury charges.

And with no perjury charges, Mundy has said over and over, there might never have been a criminal case against Barry.