Elizabeth W. Spencer, a veteran member of the Montgomery County school board and a lifelong Republican, will resign her seat tomorrow to challenge controversial fellow board member Marian L. Greenblatt for the Republican nomination for the 8th District Congressional seat.

Spencer, 56, a moderate-to-liberal member of the board, will file in Annapolis on Tuesday morning, the filing deadline in Maryland, and then will hold a press conference on the courthouse steps in Rockville to kick off her campaign.

Sources said Spencer decided in recent weeks to resign from the board and run for Congress because she believes that Greenblatt, a recent convert to the GOP, is using the nonpartisan school board as a base for political advancement. Greenblatt, whose term does not expire until 1984, has said she will remain on the board while running for Congress.

"Elizabeth is a highly moral woman," said one party worker who has been close to Spencer for several years. "She doesn't regard Marian as a Republican regular, but as an opportunist who is using the party to her own advantage."

Greenblatt switched from the Democratic Party to the Republican Party a year ago.

In a letter mailed yesterday to school superintendent Edward Andrews and board president Eleanor D. Zappone, Spencer said that she was resigning from the board because she would be unable to "devote all necessary time and energy to carry out my responsibilities to the children and youth of Montgomery County" while running for Congress.

She cited the National School Boards Association code of ethics -- adopted unanimously by the county board in 1981 on a motion by Greenblatt -- that urges members to "avoid being placed in a position of conflict of interest, and refrain from using the board position for personal or partisan gains."

Spencer's move came as a surprise to some Republican Party officials. In keeping with her belief that school board and partisan political activities should remain separate, Spencer decided not to approach party leaders until after resigning from the board.

"It takes me completely by surprise, but I know Elizabeth Spencer has always been a faithful Republican in the past," said Allan Levey, chairman of the state GOP. "This will make for a very interesting primary. Now it's a whole different ball game."

Some Republicans, who are distressed by Greenblatt's recent harsh attacks on Democratic incumbent Rep. Michael D. Barnes and have been seeking an alternative to Greenblatt, welcomed Spencer's entry into the race. Privately, a few Republican leaders have conceded in recent weeks that they are embarrassed by Greenblatt's charges that Barnes is a "supporter of the PLO Palestinian Liberation Organization " -- charges that have cost her valuable support in the county's Jewish community.

"Someone who is a moderate Republican will be a lot more acceptable than a strident, ultraconservative Marian Greenblatt, who shoots from the hip," said one leading Republican who asked not to be named. "A quiet, diligent moderate-to-conservative who has done a yeoman's job on the school board might be quite appealing to Democrats and Republicans."

Barnes, apprised of Spencer's decision to enter the race, said the challenge to Greenblatt was neither "suprising nor unexpected. It's not suprising that they the Republicans would want someone they can present to the public with a straight face."

Greenblatt said she had heard rumors that Spencer might run, but had thought they were "a joke" because Spencer recently had been "showing off" photographs of a new home she had bought in Kentucky. Greenblatt said that her own position now would be perceived as being the candidate "in the middle," with Spencer "on the left" and a third candidate, Kurt Summers, "on the right."

While Greenblatt has been a focus of controversy during much of her six-year tenure, Spencer has tended to keep a low profile on the board, to which she first was elected in 1974. But Spencer became increasingly outspoken during the school closing debates last year, attacking Greenblatt and Greenblatt's allies for taking actions that Spencer decried as self-serving and unfair.

She criticized Greenblatt's majority faction on the board for approving a series of school closings and boundary changes in the Silver Spring area -- changes that the Maryland Board of Education reversed last week in an unprecendented action.

Although she does not yet have a formal campaign organization, Spencer is expected to draw support from diverse segments of the community as a result of her participation in school affairs. She is active in the Baptist Church, and has experience as a teacher and in the farm business.

"She is a person who is very much influenced by her ethical and religious upbringing," said county NAACP chairman Roscoe R. Nix, who served on the school board with Spencer for four years. "She is a person independent in her thoughts, but guided by a sense of fairness and justice."