City Council member John Ray set the tone for a lively D.C. mayoral forum yesterday--the first such session to be broadcast to a citywide audience--saying Marion Barry does not deserve a second term while his leading challenger, Patricia Roberts Harris, doesn't deserve a first.

The forum--broadcast on WHUR-FM, Howard University's radio station, and sponsored by WHUR and The Rep Inc., a drama group--featured spirited exchanges among the candidates, with incumbent Barry the target of most of the criticism but Harris coming in for her share as well.

"The current mayor flip-flops all over on important issues," Ray said in his opening statement. "He took no stand on the no-fault insurance bill and he did nothing at all with crime until it was an election year.

"Mrs. Harris never paid any attention to our city," Ray then added, "not enough to even vote for a mayor in the election in 1978. She is a black woman on the board of IBM but she voted to continue IBM's business in South Africa."

When a telephone caller asked Ray to explain further what he had said about Harris, Ray repeated what he had said, prompting Harris, in stern tones, to respond that Ray was distorting the reasons for her vote to have IBM continue doing business in South Africa and that he was not telling the truth when he claimed she had not voted in the 1978 elections.

"IBM and South Africa are in opposing positions every day that IBM is there," Harris said, "because IBM does not segregate its employes. It would have been a loss to those people working there for IBM and a loss of an example of racial integration to South Africa for IBM to leave there."

Harris then said that she voted in both the Democratic primary in 1978 and in the general election, adding that she hoped the city doesn't have "someone asking to be mayor who distorts the facts."

While Ray tried to continue his argument with Harris, Barry was busy handling an assortment of critical statements by the seven candidates appearing with him as well as critical questions from telephone callers and the audience.

An independent candidate, John J. Wambule, complaining that "people out here are hungry," asked Barry why the city government is not working.

City Council member Charlene Drew Jarvis (D-Ward 4) picked up the allegation, contending that Barry had not made serving people who live in the city a priority of his government.

"It's an established priority of Barry's administration to win the election," Jarvis said. "It's an established priority to raise money. I've talked to agency heads and they've told me what they have to do. But it's no priority to serve people."

The pressure on Barry continued when a telephone caller asked him how he viewed his endorsement by Del. Walter Fauntroy after he had denounced Fauntroy's endorsement of former City Council chairman Sterling Tucker in 1978 as "bossism."

"I like that question," Barry said. "It demonstrates good political sense. But it's the way of the political system to go after endorsements and I am going after every endorsement.. . . I'm proud of any endorsement I get."

Barry's handling of city finances also was strongly criticized. After Barry had said that he came into office to find the city's finances in "chaos" and he had straightened them out, Morris Harper, a physician running in the Sept. 14 Democratic primary, caustically said: "If you believe what the incumbent tells you about the budget you'll believe anything."

Also at the forum were independent candidate Dennis Sobin and Republican candidates James E. Champagne and E. Brook Lee.

Later yesterday, in the first televised confrontation among mayoral contenders, the four leading Democratic candidates appeared in an hour-long miniforum on WDCA-TV (Channel 20) sponsored by the station and the D.C. Ad Hoc Women's Committee. Although Barry, Harris, Ray and Jarvis were all questioned by panelists in the first 30 minutes of the program, only one question was asked of Ray and Jarvis by viewers who phoned the station during the last half-hour. That question for the council members--neither of whom has received more than 5 percent support in recent polls--was why they bothered to remain in the race.

"I'm in the race because I'm the best candidate," replied Ray, who added later that "if you want four more years of what's going on, then you should vote for the incumbent."

Jarvis defended her candidacy by saying she was more familiar with the city and its problems than any of her opponents. "I'm in the race because we have problems that can't wait another four years," she said.

Most of the questions from viewers were directed to Harris, and they were generally critical of the former U.S. ambassador and Carter cabinet secretary for allegedly not having been more involved with local politics before running for mayor.

In response to one such question, Harris listed about a dozen local positions she has held, that of presidential elector for the District in 1964 and leadership of local Urban League committees. She also noted her activities in the D.C. Bar and her local civic association.

"I regret that you were not aware of all I have done but I have been involved," Harris told one viewer.

Questions for Barry included one from a young man who said he had not yet received a salary check for his city-sponsored summer job, which was due last week. Problems with checks have plagued the summer jobs program during Barry's administration.

"Last week we paid 20,000 young people on July 6. On time," Barry said in response. "You must have been one of the five or six people who had a problem."