Several D.C. City Council candidates, including incumbent John L. Ray, told a homosexual rights forum last night that they would support the repeal of the city's sodomy law, which bars forms of sexual activity other than intercourse.

"What two or three consenting adults do behind closed doors is their own business," Ray told an audience of about 100. "I don't want any policeman spying through my door to see what I'm doing."

Four other candidates for the atlarge council seat vacated in January by Mayor Marion Barry voiced similar support for repealing the law. They are Hector Rodriguez, Jackson Champion, Warren A. Hemphill Jr. and Frances Goldman. Only Richard Blanks Sr. took a contrary view.

The comments were made in response to a question from the audience at the forum, sponsored by the Gay Activists Alliance and four other organizations. It was held at the Washington Ethical Society, 7750 16th St. N.W.

Ray was appointed by the D.C. Democratic State Committee to fill Barry's seat until a May 1 special election. Twelve candidates have filed for the seat, including Douglas E. Moore, who has campaigned against liberalized rights for homosexuals. Moore was invited to the forum but did not attend.

Ray, asked why he supported Moore for council chairman last year, replied that Moore, despite differences from Ray policy and style, was a fighter for the oppressed.