RICHMOND, DEC. 18 -- Virginia Gov. Gerald L. Baliles, cheering the legislature's fiscal committees with some rosy economic news, said today that state government revenue during the next two years will likely climb by $378 million over earlier estimates.

At the same time, the governor, who is putting the finishing touches on the state's 1988-90 spending plan, said his forthcoming biennial budget will be tempered by continued uncertainty about the stock market and consumer spending. "We cannot do it all," Baliles said here at his traditional year-end forecasting session with the money committees of the state Senate and House of Delegates. "We cannot replace every lost federal dollar or support every good idea."

Nonetheless, by almost every index the state treasury appears to be in good shape, bouyed by Virginia's recession-resistant economy, an expected $154 million surplus and an unemployment rate rivaling that of the mid-1970s, budget analysts said today.

Moreover, given the state government's traditional practice of underestimating revenue, the future may be even brighter than it appears now, according to several officials and legislators.

For instance, Baliles' forecast did not take into account the millions of dollars the new state lottery will begin generating after next spring.

"Virginia will do better than the rest of this country," declared Stuart W. Connock, Baliles' finance secretary. "This forecast is not a negative forecast."

A year ago, the state projected that revenue to the government's general fund from such items as individual income, corporate and sales taxes, insurance company premiums and an array of other fees would amount to just under $5 billion by 1988, about $5.2 billion in 1989 and nearly $5.6 billion in 1990. All three figures jumped slightly under the new estimates, for a total of $377.8 million in extra funds through 1990.

"Although we'll see some of the effects of what happened in the stock market, the state economy should fare fairly well," said state Del. C. Richard Cranwell (D-Vinton), who is in line to become chairman of the House Finance Committee when the General Assembly convenes next month.

In the budget debate that will dominate the upcoming legislative session, Republicans are sure to use today's forecast when pressing for a variety of tax cuts, including a reduction in the state income tax rate and eliminating the sales tax on food and certain drugs, among others.

In addition, GOP leaders said they will try to force the Baliles administration to identify -- and then return to taxpayers -- any additional revenue windfall the state will reap as a result of changes in federal tax law.

Baliles and the fellow Democrats who control the state House and Senate almost certainly will resist any tax cuts in 1988; the governor has contended his budget will simply be too tight for that.

Baliles told the legislative committees today that merely maintaining the state's share of Medicaid health care programs for needy people would eat up the entire $154 million surplus. If the state allocates $500 million in new money for education in the next biennuium, as it has in the past two budgets, "that alone would exceed all of our new revenues and the budget surplus combined," Baliles added.