The energy industry has been in a phase of transition over the past year as many high-flying pandemic stocks fall to earth and the market grapples with the future of electricity prices and electric vehicle sales. As we near 2024, I think there are some opportunities that the market is overlooking.

After a terrible 2023, renewable energy stocks SunPower (SPWR 5.85%) and NextEra Energy Partners (NEP -0.89%) are well positioned for a recovery in 2024, and even an oil company like ExxonMobil (XOM -2.78%) looks like a great buy. Here's why I like these stocks right now.

Diagram balancing fossil fuels and renewable energy assets.

Image source: Getty Images.

1. SunPower

Higher interest rates hit the solar industry hard in 2023. As rates went up, it became more expensive to finance rooftop solar installations, and that meant companies like SunPower needed to either charge customers more for electricity over time or cut installation costs. Neither happened last year, and both installations and margins struggled as a result.

But 2024 may turn out a little differently. Interest rates have been dropping recently, and the market thinks short-term rates will fall as early as next spring. Inflation is also slowing, which will help both material and labor costs. We have also seen utility prices rise quickly because of inflation and higher commodity costs. According to the U.S. Energy Information Administration, residential utility bills jumped 13% last year, and regulators have approved further increases in 2023.

Add all of these trends up, and SunPower should see better economics in 2024. I think it will be one of the best-performing energy stocks as a result.

2. NextEra Energy Partners

The story for NextEra Energy Partners in 2023 was also about interest rates. The company has to refinance $2.2 billion of debt before 2026 and investors are worried that higher interest payments will lead to lower dividends.

But a recent look at rates shows that they're not rising as fast as you might think and the last few weeks have seen a big drop. NextEra Energy Partners could use this as an opportunistic time to refinance and lock in rates for a very long period.

10 Year Treasury Rate Chart

10-Year Treasury Rate data by YCharts.

Management has also set payout targets that the market doesn't seem to believe right now. For 2023, they have said distributions will be $3.52 per share at an annualized rate by the end of the year, and distributions will grow 4% to 8% through at least 2026. Given the stock price of $25.41 per share, the dividend yield is 13.9%, and I think that's too good to pass up.

3. ExxonMobil

Renewable energy may be taking market share in energy, but the oil and gas business isn't going anywhere. ExxonMobil continues to be extremely profitable, and we have seen the industry overall be more conservative in how it's investing in new production.

That conservatism will help cash flow remain strong and could mean we avoid a massive downcycle when oil and natural gas prices fall during an economic downturn. I think that means ExxonMobil's cash flow will remain strong, and 11.3 times free cash flow is a great price for the stock.

XOM Free Cash Flow Chart

XOM Free Cash Flow data by YCharts.

Note: The gap in the above chart represents negative cash flow.

As a diversified oil major, this is the safest of the three stocks I've covered, but it's a great stalwart to have in any energy portfolio.

Riding the energy tailwinds

The long-term trends are still clear for energy overall. Solar and renewables are taking market share, which should be bullish for SunPower and NextEra Energy Partners. But fossil fuels are also in a cash-generation cycle, and that will help ExxonMobil return cash to shareholders in the long term.