Programs for the elderly are being slashed in Maine. Government jobs are being eliminated in New Jersey. Prison construction has been put off in Virginia. Some schools in California will end their music programs.

About half of the state legislatures nationwide are scrambling to plug gaps in their budgets, shot through by rapid declines in corporate and sales tax revenue, distressed housing markets and a national economy on the verge of a recession.

Many states are reporting their largest budget shortfalls since the recessions of 2001 and 1991-2. In some states where tax increases are generally anathema, including Maryland and Kentucky, governors are looking to raise some levies.

"It is not just the standard downturn where unemployment rises for a while, income tax and sales tax revenues are weak, and ultimately the economy recovers," said Iris Lav, the deputy director of the Center on Budget and Policy Priorities, a liberal research group in Washington that tracks state budgets.

Lav pointed to a confluence of factors — including weak consumer spending, high energy prices, dropping housing values and growing foreclosure rates — that suggest states will face a protracted struggle to keep their budgets afloat.

"This all will make it harder to recover," she said.

As of last week, at least 25 states were expecting budget shortfalls for the 2009 fiscal year, according to the budget center, findings that are consistent with other state roundups and an informal phone survey by The New York Times. It is the largest number since 2002, when in the aftermath of the 2001 recession 37 states were forced to cut their budgets.

Many of the states this year owe their problems to stark declines in tax revenues after an implosion in housing markets. In most cases, states have moved to slash state spending, particularly in education. Lav said that eight states are cutting into the budgets for higher education, and nine states are cutting into their financing for primary and secondary education.

Ballooning health care costs have vexed many states over the last decade, and nine are now trimming their Medicaid programs, particularly programs for children.

Many states are cutting government employees or trimming raises.