The price of gas has fallen precipitously in recent months, with oil well off its high of more than $100 a barrel in the middle of last year. That should be great news, right? Well, not if you’re a state that relies on production and extraction taxes to fill huge parts of your budget.

For a handful of oil-producing states, lower gas prices mean mounting budget headaches. In Alaska, which relies on oil and gas revenues for more than 80 percent of its state budget, Gov. Bill Walker (I) has proposed cutting 300 state jobs as part of an effort to cover a $3.6 billion budget deficit — or about $10 million a day.

No other state relies so heavily on the industry, but New Mexico, Louisiana and Texas all get more than 10 percent of their revenues from oil and gas. Losing even a few percentage points because of falling prices can create a real hole.

Texas is likely to have to dip into its $8 billion rainy-day fund. Louisiana Gov. Bobby Jindal (R) is struggling to cover a projected $1.6 billion shortfall, created in part thanks to lower gas prices.

But the lower prices are actually good for other states, where the sales tax makes up a bigger source of revenue. A new report from Moody’s Investors Service finds states like Florida, Nevada and Washington — all of which generate a much higher percentage of their revenue from sales taxes — will benefit, at least somewhat, from the lower prices.

That’s because gas prices are closely tied to consumer sentiment. In recent months, the University of Michigan’s index of consumer sentiment has risen just as much as gas prices have fallen. Consumer spending on fuel and vehicles also rises as gas prices fall, Moody’s said.

And the higher the gas price, the less people drive. Year over year price spikes tend to lead to fewer cars on the road, while falling gas prices have more people taking road trips, especially in recent months. That can be good news for toll roads, like the Pennsylvania Turnpike and the New Jersey Turnpike.

Gas prices are a net positive for consumers, but for state agencies, the picture is much more complex. Especially in Alaska.