RICHMOND, Oct. 12-Republican Sen. John W. Warner and his Democratic challenger, Edythe C. Harrison, clashed tonight in a sometimes testy television debate over defense, abortion, prayer in the schools, women's rights and budget issues.

Harrison, a former state legislator from Norfolk who has trailed Warner in fundraising and polls, aggressively and repeatedly sought to put the first-term senator on the defensive. At one point she attacked him sharply for accepting about $200,000 in contributions from defense industry political action committees.

"It pains me to bring this up," Harrison said, citing recent reports of waste in the Defense Department on items such as $7,000 coffee brewers and "sophisticated systems that don't work." She suggested Warner, a member of the Senate Armed Service Committee, was reluctant to correct the abuses because of his contributions.

Warner, 57, responded sternly that "the inference is that for $5,000 the legal limit for PAC donations John Warner would sell his vote. Virginians don't believe that." He noted that Harrison also has received PAC money.

The senator acknowledged that Virginians "are hopping mad" over Pentagon waste and said he and the Reagan administration have taken steps to control abuses.

Harrison, 50, said she would support some type of limit on campaign spending while Warner said he would study the issue. "I share the concern, we don't have the answers," said Warner.

He has raised and spent nearly $2 million compared to about $400,000 for Harrison, who has agreed she is the underdog in the state's Nov. 6 elections.

Their 90-minute debate was broadcast over seven public television stations and was sponsored by the Capitol Correspondents Association, a group of news reporters who cover Virginia government.

In contrast to Harrison's aggressive style, Warner several times said he agreed with issues his Democratic opponent raised and complimented her on her grasp of issues.

"I thought she was imminently fair," Warner said after the debate. He said his deference to Harrison was not a campaign tactic but his "style." Harrison told reporters later "I won the debate."

The voters "know I'm credible," Warner said in questioning several Harrison statements on arms control. Harrison said Warner "flip-flopped" on issues, first opposing then supporting the extension of the 1965 Voting Rights Act and the Martin Luther King holiday bill. "I changed my mind . . . I'm proud of those two votes," Warner said.

Throughout the debate, Harrison and Warner repeated largely the same positions they expressed during a one-hour debate in Virginia Beach last month.

Tonight, in response to questions about prayer in schools and religion, Harrison said she would reject any endorsement from television evangelist Jerry Falwell of Lynchburg. Warner said the issue has not come up and he would address it only if it did.

On prayer in schools, Harrison said she opposed a proposed constitutional amendment to allow organized prayer in schools. Warner countered that "it can work" and said students should be allowed to pray at school without interference or instruction from either parents or school officials.

Warner said he would support a constitutional amendment to allow individual states to set abortion policy. He said he favors abortion only in cases of rape, incest or danger to the health of the mother. Harrison said the amendment would be "returning women to back alley abortionists . . . We will lose thousands of lives."

Harrison repeated her support for the Equal Rights Amendment, calling it a "litmus test of somebody's true feelings and actions" for women's rights. Warner said he would consider another ERA measure but objected to the one that died last year.

Warner stressed his strong support for President Reagan's economic policies which he said had brought the country out of a disasterous economy of high interest rates and inflation under President Carter.

Harrison said the nation's debt, which has risen $600 billion in nearly four years to $1.6 trillion, said the "American people are frightened because we cannot live in a house of cards."