Oil and gas stocks have led the market higher so far in 2021, a surprise after struggling for years to generate market-beating returns. Rising oil and natural gas prices have driven energy stocks higher and an improving economy could help demand and prices throughout the year. 

Below, I've highlighted Marathon Oil (MRO -1.01%), Diamondback Energy (FANG -0.77%), Devon Energy (DVN -0.46%), Occidental Petroleum (OXY 0.09%), and ExxonMobil (XOM -0.09%). These are not only some of the biggest energy companies in the U.S., they're also among the top performers in the S&P 500 this year.

So, is now a great time to get into hot energy stocks or time to cash out? Here's what investors should keep in mind. 

MRO Total Return Price Chart

MRO Total Return Price data by YCharts

Why oil and gas prices are rising

You can see below that both oil and natural gas prices are up sharply in 2021, including a spike in natural gas in February. The rise has been driven by a rise in demand for commodities as businesses and consumers get back to more ordinary economic activity. And suppliers couldn't ramp up demand fast enough to keep up, the opposite of the demand drop and oversupplied market we saw in mid-2020. 

Henry Hub Natural Gas Spot Price Chart

Henry Hub Natural Gas Spot Price data by YCharts

What isn't clear yet is whether higher prices will last. And there may be reason to think they won't. 

Drilling rigs on a prairie at dusk.

Image source: Getty Images.

Cutting back on expenses is paying off ... for now

One stroke of luck for oil and gas stocks is that companies cut back on capital investment when commodity prices were low and demand for oil had fallen during the pandemic. The cutbacks are understandable because companies didn't want to flood the market and make the problem worse. Prices have gone up, but capital spending budgets haven't caught up yet. 

MRO Capital Expenditures (TTM) Chart

MRO Capital Expenditures (TTM) data by YCharts

Similar trends are taking place with operating expenses. You can see that operating expenses are double digits lower for ExxonMobil, Marathon Oil, and Devon Energy while Occidental Petroleum and Diamondback Energy are lower over the past year but are up on the chart below because it includes acquisition-related increases in costs. 

MRO Total Operating Expenses (TTM) Chart

MRO Total Operating Expenses (TTM) data by YCharts

Operationally, cutting back on capital spending and operating expenses when commodity prices are rising is a recipe for higher profits and stock prices. The trend may not last for long, but for now it's helping oil and gas stocks. 

Follow the long-term trends

Over the last few months, oil and natural gas prices have risen sharply, but that's not consistent with long-term trends. Renewable energy production is rising, which over time will displace natural gas. EV production is also rising, which will hurt oil demand long-term. Over the next decade or two, it's likely both oil and natural gas demand will be hurt by competing energy sources. 

US Oil Consumption Chart

US Oil Consumption data by YCharts

Even since 2005, which the chart above covers, fossil fuel prices were fairly weak despite wind, solar, and electric vehicles only taking up a small portion of the market. Oil prices were up 11.2%, which isn't even keeping up with inflation. Natural gas prices dropped an incredible 48.5%. 

WTI Crude Oil Spot Price Chart

WTI Crude Oil Spot Price data by YCharts

If we take a step back and look at the long-term trends, I don't think macro trends are favoring oil and gas stocks. 

Earnings trends are terrible in oil and gas

We see the relative price and demand weakness in earnings as well. Below is the change in revenue and net income for the five companies I highlighted above over the last five years. You can see that only Diamondback Energy and Occidental Petroleum have grown revenue, driven by acquisitions, and every company has seen earnings decline sharply. Even before the pandemic, earnings were falling. 

MRO Revenue (TTM) Chart

MRO Revenue (TTM) data by YCharts

It's these long-term trends that would worry me as an investor. I don't see the threat from renewable energy and electric vehicles subsiding anytime soon and that will hurt demand and prices over time. The start of 2021 may have been great for oil and gas stocks, but the future doesn't look bright for the industry.