The carbon tax, I am thinking of, would be a variable rate tax. If fossil fuels are too cheap, the tax would boost the price so fossil fuels would not undercut alternative energy in price. The tax could be reduced when the market price of fossil fuels goes back up.
This would, of course, mean adding a tax during recessionary times since that's usually when fossil fuel prices tank. A tax during recession is a no, no, but that is where Modern Monetary Theory could be applied. Instead of trying to boost ourselves out of a recession with tax cuts, we could use new money to stimulate the economy. That's what we did during the pandemic recession.
Modern Monetary Theory basically says don't worry, that much, about deficit spending since it can be funded by creating new money. Don't worry too much during a recession at least. Maybe start worrying during inflationary times.
I know I'm probably simplifying it too much, but that's a glance at part of the concept of Modern Monetary Theory, as I understand it.
If we use deficit spending to stimulate the economy during recessions, maybe we could use carbon taxes to keep the price of fossil fuels high enough so it doesn't keep undercutting alternative energy. We could, maybe stabilize that highly volatile price at least.