Less than a year ago, Republican leaders in Montgomery County searched desperately for a candidate -- any candidate -- to run for the 8th Congressional District seat held by Democrat Michael D. Barnes. Now, on the eve of Tuesday's election, the same Republican leaders are faced with a hot primary contest that centers mainly on the personality and tactics of one contender, Marian Greenblatt, the controversial leader of the embattled county school board.

Party leaders say the outcome of Greenblatt's race against the leading challenger, Elizabeth Spencer, who resigned from the school board in an attempt to stop Greenblatt, is too close to call.

Whoever gets the nomination, Spencer, Greenblatt, or the other two GOP candidates, Phillip Buford and Kurt Summers, is expected to be an underdog in November against Barnes, who has no primary opposition. Even so, the race has generated much interest, with left-over school board issues playing a part in determining the winner.

"There's a race there," says Allan Levey, chairman of the Maryland GOP and a state senate candidate in the county. "Marian Greenblatt has had a campaign organization longer so she has a step up. But there is a lot of sentiment out there for Elizabeth Spencer. It's one of those races where you won't know the outcome until people have gone to the polls."

The drama of the race stems from a long-standing personal riValry between Spencer and Greenblatt, who in six years on the county school board sparred frequently over education issues and the style of leadership.

Spencer, who entered the race two months ago, has had little time to put together an organization or raise money, although she will have a phone bank. literature drop, and media blitz before Tuesday's election. She has issued position papers on several issues but has had difficulty finding a campaign theme. Her bigqest handicap, according to party sources, is that she is not as well known as her outspoken opponent.

Despite these disadvantages, the 56-year-old Spencer has attracted a number of converts from Greenblatt's campaign, many of whom were distressed by Greenblatt's penchant for controversy.

Some party leaders say privately that although they have endorsed Greenblatt they will vote for Spencer. "To tell you the truth," said one of them, "I'm going to vote for Elizabeth. There is an undercurrent through out the county of people who are for her. Marian could actually be an embarrassment to the party because of the stands she has taken during this campaign and on the school board."

There are few ideological differences between the candidates, at least on national issues. But Spencer's supporters point out that she is a lifelong Republican, unlike Greenblatt, who switched to the party last year and was a volunteer for liberal Democratic presidential candidate George McGovern in 1972.

"There is no doubt that Elizabeth is a solid, conservative Republican," said state Sen. Howard A. Denis, one of the county's four Republican officeholders. "She is more in the . . . progressive tradition that has characterized our party's efforts for a generation."

Greenblatt, 40, was recruited for the congressional race by some members of the party who hoped to prove that a conservative could be nominated in a county where in recent years only moderates were victorious. Greenblatt, who did not give up her school board seat when she entered the race last spring, has sought to defuse Spencer's challenge by portraying her as a "spite candidate" who isn't serious about the office. Although Greenblatt has a solid campaign organization, including a professional campaign manager, she alienated some key Republicans at the outset by declaring that Congressman Barnes is "a supporter of the PLO Palestinian Liberation Organization."

That attack on Barnes, seen as an effort to attract Jewish voters and capitalize on her own ethnic background and perhaps to distance herself from her controversial role on the school board, backfired. The Jewish Weekly chastized her in its editorial columns. Shortly thereafter two popular Republican politicians, Denis and Del. Constance A. Morella, withdrew from Greenblatt's steering committee. And a faction of Greenblatt supporters were stymied in their efforts to get the party central committee to endorse her.

Recently, the two leading county newspapers and The Baltimore Sun endorsed Spencer over Greenblatt, citing their contrasting styles and positions on the school board. The Montgomery Sentinel asserted that Greenblatt was "unfit" for any public office, which Greenblatt and her allies immediately termed "an affront to the voters." (Spencer has avoided using the editorial to boost her own campaign.) The Sun said Greenblatt was "given to irresponsible statements," and described her as "a combative right-winger whose work on the school board has been a source of division and tension." Only the Gaithersburg Gazette has endorsed Greenblatt.

Last week, Spencer charged that Greenblatt falsely implied that the Republican National Committee had endorsed her by listing a campaign contribution from the RNC in her campaign literature. James Teese, Greenblatt's campaign manager, admitted later that the RNC contribution was not cash, but voter lists that are provided free to all Republican candidates.

Greenblatt insists that she will win ("the question is, by how much?" she said) because "the entire Republican party" is behind her. Former congressman Newton I. Steers, a GOP candidate for lieutenant governor, is on her steering committee, but has not been active in her campaign. Greenblatt also notes that Rep. Marjorie Holt, from Maryland's 4th District, has attended two of her fund-raisers, as has Rep. Lynn Martin of Illinois.

Greenblatt's campaign has been an effort to transform a negative image into something positive. Her campaign literature and bumper stickers refer to her as "Marian," not Greenblatt, which some party members say was a conscious attempt to soften her image.

Her supporters also seek to make her outspokenness a campaign asset. "Someone who is going to beat Mike Barnes has to be ready to do battle," said Forbes Blair, former county GOP chairman and a member of the central committee who recruited Greenblatt for the race. "We have to get touch to show who this Barnes fellow really is. He's an ultra-liberal."

Party leaders expect roughly 25,000 Republican voters to turn out for the prlmary. "It comes down to a question of approach, and how you go about doing things," says one leading Republican. "The race will be very, very close. A lot of people aren't saying who they are really going to vote for."