Hundreds of millions of dollars will flow to MUNI, BART and other area mass transit agencies if Gov. Arnold Schwarzenegger signs the $131 billion state budget as expected Friday.

The money, much of which comes from gasoline tax revenues, holds the promise of everything from better bus security to train bridge retrofit projects.

Previously, 21 Bay Area transit agencies were expecting a total of about $57 million in state funding. That figure has, this month, ballooned to $204 million, largely attributable to a so-called “spillover” of tax money generated by rising gas prices.

“This is a lot to swallow at once,” said Bay Area Metropolitan Transportation Agency Executive Director Steve Heminger. “This is a big increase.”

H.D. Palmer, a spokesman for the California Department of Finance department, said that the bulk of the funds may be used for either covering financial costs or physical projects.

Since the money comes from four distinct pots of state money, there are complex requirements about what the various funds can be used for.

Transit agencies Wednesday were sifting through the revenue stream information while contemplating what the money could be used for.

“We’ve got to look at where the money can be spent,” said Muni spokeswoman Maggie Lynch. Muni has in recent years struggled to stay in the black by increasing fare twice in two years and cutting service. Lynch said the agency plans to focus on improving the condition of its vehicles and could hire more mechanics or agents.

The BART may use some of the funds to pay off outstanding debts on its $1.4 billion SFO extension project, spokesman Linton Johnson said. BART will not have an operating deficit in the upcoming fiscal year, Johnson said, adding that improvements, such as repaving dangerous sections of sidewalk, are likely.

Caltrain spokesman Jonah Wineberg said many of the its trains are 30 years old and need replacing. In addition, the San Francisco-to-San Jose train agency needs to repair more than a dozen bridges, grade separations, and improve a number of stations, Wineberg said.

“There’s not a public transit agency in America that’s not in need,” said Clarence Johnson, a spokesman for AC Transit, which runs buses in the East Bay.