Up until recently there were very lucrative power purchase agreements that would offtake your solar generation st great rates for decades.
The problem is one of scale and expertise. These projects are smaller than the many billion dollar capital projects that fossil fuel companies usually embark upon. Those large fossil fuel projects also have super long payback periods, not too dissimilar from renewables.
However we don't see a ton of fossil fuel expansion even with the current price spike, because there's a huge huge huge risk that any new projects started will never pay themselves back. ESG efforts have reduced appetite for capital expenditures, and other shareholders are demanding strict capital discipline. Which is for the best for all involved. We can't afford, environmentally, to star any new big fossil fuel extraction projects. The big question is who will be left holding the bag as we phase fossil fuels out.
With renewables, you're locked in for decades when you sign the contract. There's no upside swings.
And oil isn't a great business to be in either. Return on Equity for the whole US industry since 2010 or so has been ~0%