Oil has dominated the energy market for more than a century. Because it's the primary fuel of the global economy, oil stocks can produce big gains when prices are higher.

However, oil is also a major problem. It creates a lot of greenhouse gas emissions when produced and burned, which is bad for the environment. Cleaner alternatives such as renewable energy are therefore working overtime to knock it off its throne. With that backdrop in mind, here's a look at whether oil stocks or renewable energy stocks are the better ones to buy.

People looking at a laptop with wind turbines in the background.

Image source: Getty Images.

The buy thesis for oil stocks

The price of crude oil has gone on an unbelievable run over the past year. West Texas intermediate, the primary U.S. benchmark price, has more than doubled as it recovered from a devastating crash early last year brought on by the pandemic. That's helped fuel a similarly epic run in oil stocks. For example, the SPDR S&P Oil & Gas Exploration & Production ETF has rallied more than 60% during that timeframe. Clearly, when oil prices are in rally mode, oil stocks can be great investments.

While there's some uncertainty about oil's long-term future, the International Energy Industry expects crude oil demand to remain healthy for years to come. In its view, global oil consumption will rise from an average of 97.9 million barrels per day in 2019 to 104.1 million barrels per day by 2040 under its base-case scenario. Even though surging renewable energy will cut into some demand for oil, its usage by the petrochemicals and long-distant transportation sectors will fuel demand growth for at least the next decade before it plateaus. 

On the one hand, that forecast suggests oil companies won't grow their production that much in the coming years. On the other hand, however, they could still create value for shareholders. Instead of reinvesting the bulk of their cash flow into drilling more wells, oil companies could return it to investors via share repurchases and dividends.

For example, a growing number of oil companies, including Devon Energy (DVN 1.02%), have initiated variable dividend programs. That enables them to return large portions of their free cash flow to shareholders each quarter. Because of capital return programs like that, oil stocks could generate compelling total returns for investors if oil demand does keep growing.

The buy thesis for renewable energy stocks

While the oil market has questionable growth ahead, renewable energy adoption is accelerating. Forecasters currently estimate that capacity additions in the U.S. alone will grow at a 15% annual average rate over the next decade. Further, the growth rate is on track to accelerate after next year. After adding 10 gigawatts (GW) of new wind and a similar amount of new solar energy from 2019 through 2022, the industry should add 12 to 15 GW of wind and 18 to 20 GW of solar per year in the 2023-2030 timeframe.

That outlook suggests that renewable-energy companies should grow at accelerating rates over the coming decade. Moreover, as they increase their scale, renewable-energy companies could become increasingly profitable as the costs of renewable energy continue declining. As a result, they could generate enough cash to invest in expanding their capacity and return funds to shareholders via dividends and share buybacks. That combination of growth and shareholder returns could enable renewable energy stocks to produce higher total returns in the decade ahead.

For example, given the sector's growth potential, NextEra Energy Partners (NEP 1.62%) expects to be able to grow its 3.7%-yielding dividend at a 12% to 15% annual rate through at least 2024. That makes it one of the top renewable-powered dividend stocks.

The long-term choice is clear

Oil appears as if it will remain a vital fuel for the global economy for at least the next two decades. So oil stocks could do reasonably well in the coming years, especially as they focus on returning cash to shareholders.

Meanwhile, renewables are just hitting their stride. The sector appears poised for accelerated growth over the coming decade, and renewable-energy stocks could produce high-powered total returns. That makes them the clear better buy over toil stocks for investors with a long-term mindset.