Sharon Pratt Dixon, the campaign director for Patricia Roberts Harris, was having lunch with a reporter in a downtown restaurant last week when Mayor Marion Barry came by the table, smiled and said hello.

The reporter tried to ask the mayor if he was willing to debate Harris and his other Democratic challengers on television. The smile disappeared. "I don't want to answer any questions," Barry interrupted and then began to leave. "I just came by to say hello."

Dixon shook her head. "Barry is running scared," she said.

Dixon's assessment was an extreme and perhaps wishful characterization. But clearly, with two weeks to go before the Sept. 14 primary, the watchword of the Barry campaign is caution.

Barry and Harris aides agree that the latest private polls indicate that he is ahead in popular support, that he has outdistanced Harris, his leading opponent, in organizing and that he has used the incumbency to capture virtually every significant endorsement so far.

Yet the uncertainties of a final week of live radio and television appearances and the wild-card candidacies of Charlene Drew Jarvis and John Ray have created last-minute jitters in the Barry camp, where strategists are avoiding any move that could result in a critical blunder.

Barry, the former street activist who so often has been an underdog in life and politics, this time is ahead on points, and his usually aggressive political style has been replaced by shrewd and sometimes evasive tactics that frustrate efforts to smoke him out.

The most visible sign of that strategy is Barry's refusal to formally debate his three challengers live and on prime-time television. First, he rejected a one-on-one showdown with Harris and then, last week, two other proposals that would have involved all the Democratic candidates.

"He's afraid he'd have to answer questions he can't answer, like how the government operates," said Harris, who considers the 11th-hour debates crucial to her chances of winning and complains that there is no opportunity to rebut Barry at candidate forums. "I know more about his budget and how the government functions than he does."

"It's unbelievable a mayor will refuse free time to discuss the issues in this campaign," said Harris, a lawyer and Carter administration cabinet member. "What's he afraid of? Who is he running from?"

Ray also is critical of Barry's tactics: "There are questions he would have to answer about his record in a debate that he has not answered. In the forums he didn't have to answer questions directly. He says he has this program and that program and everyone listening says it sounds like the city is doing something.

"He can't defend his record. No one can. That's why he's ducking the debate."

Barry's avoidance of the formal debates is a sharp contrast to 1978, when, during the final days of the campaign, his long-shot candidacy caught fire with an aggressive, all-out performance in televised joint appearances with incumbent Walter E. Washington and Sterling Tucker, the 1978 front-runner.

This year, the only live televised appearance Barry is scheduled to make with his challengers is an informal, late-evening talk show Friday on WDVM-TV (Channel 9), and that's how his strategists prefer it.

Paul Lutzker, a political consultant to Barry, said Barry's goal in any television appearance is to come across as a rational, warm person among opponents anxious to snipe at him.

"The danger in a TV debate," Lutzker said last week, "is that a lot more people are watching than a forum . . . . If you make a mistake, you make it before that many more people and it reaches people that much more quickly because it is on TV."

For his part, Barry says last week's flap over debates was a phony issue concocted by Harris. "This debate about debate is like the sideshow running away with the circus," he said. "Mrs. Harris has not had a clear articulation of the issues. It's a good way to distract voters from what she should be doing."

The urgency that the three challengers attach to the debates underscores the status of the campaign in other key areas, as Harris, Ray and Jarvis scramble to put together winning combinations of support.

A Washington Post poll taken in June showed Barry 13 points ahead of Harris and virtually out of the reach of Ray and Jarvis. Polls taken since then by the Harris campaign indicate that Barry is in the lead.

The Barry organization is not smug. There are no fail-safe assurances that in the privacy of the voting booth, the big-name endorsements, his smart use of patronage and the election year glow of the city's bureaucracy and its services will dim the memory of problems that plagued his administration.

And then there is the Ray-Jarvis factor.

Although The Post's poll found that neither received more than 5 percent of the vote, that amount could tip the election to either of the two major candidates in a close race.

Privately, Barry campaign strategists acknowledge the effect that Ray and Jarvis could have. Barry told a reporter Friday, however, he had not considered the Ray-Jarvis factor.

"We intend to get 50 percent of the vote or more," he said. "How Charlene, John Ray or Harris divide up the other 45 percent of the vote is of no concern to me."

It is of concern to Harris campaign strategists, who believe that a majority of the Democratic voters are opposed to Barry, and fear that even if most vote against him, he could win if the anti-Barry vote is scattered too much. That would be a repeat of the close, three-way 1978 Democratic primary, which Barry won with a mere 35 percent of the vote.

"They are down there collectively below 10 percent," Harris pollster Peter D. Hart said of Ray and Jarvis. "They won't be the difference in the sense that we have to convince people to vote for us. My concern is that Ray and Jarvis probably diffuse the message of Pat as the alternative. But it is a Harris-Barry race. The voters know that."

Jarvis, who represents Ward 4 on the City Council, is seen as possibly drawing votes away from Harris in that upper Northwest Washington ward, which has more Democratic voters than any other in the city.

"She Jarvis could hurt us in four," said Dixon, the Harris campaign director. "It depends on the point of view of the voters when they make their decision. Do they want to cast a protest vote and go for Charlene or do they want to vote for a change?"

In the city's second largest Democratic ward, Ward 5 in upper Northeast, at-large council member Ray poses potential problems for Harris because he is considered especially well-organized in Precinct 66 in Michigan Park, his home precinct and the largest Democratic precinct in the city.

Harris has the strongest support in Ward 3, west of Rock Creek Park, and her strategists consider good showings in Wards 4 and 5 critical. Barry, on the other hand, is strongest in his home ward, Ward 7 in far Northeast and Southeast Washington, and in Wards 1,2 and 6, which compose the inner city and which were a key part of his base in 1978.

Ray sees himself taking votes from Barry and Harris equally among many middle-class voters. Ray, born in rural Georgia, also says that he and Barry, born in rural Mississippi, share support among those looking for a male candidate who came to the city from the South.

"What Mrs. Harris is able to do is pick up a lot of people who voted for Sterling Tucker last time," he said. "On the other hand, a lot of people who voted for Walter Washington -- people from South Carolina, North Carolina . . . people who are Baptists, Methodists, AME Zion--are going to vote for me or Barry."

Jarvis also feels her campaign could cut both ways. "I think my candidacy has been having impact with undecided voters," she said. "Many of them say, 'Mrs. Jarvis, we haven't seen or heard you before. You're the one candidate that seems to know what she's been doing and seems to be in control.'

"I think I'm drawing a lot of votes from D.C. government workers who know what is going on in the government and are really fed up with Marion."

In campaign action yesterday, Ray criticized Barry for doing little to combat crime and drug addiction.

Ray told about 100 supporters who rallied at Lincoln Park, near East Capitol and 13th streets NE, that Barry waited to beef up the city's police department until he was pushed by Congress and that his effort to fight illegal drug sales with periodic police sweeps has been largely ineffective.

Ray also claimed that mayoral candidate Harris had largely ignored the needs of the city until recently.

"While other cities were getting millions of dollars from her agencies, Washington was getting shortchanged," Ray said. "This mayor didn't know how to get federal grants, and Pat Harris didn't care enough about Washington to bring him in and teach him how to do it."