This has been a painful year for stock market investors, as nothing seems to be working.

There is an exception: Energy. It’s the best-performing sector and might still be a bargain for those who can be patient.

A snapshot of the 11 sectors of the S&P 500 SPX, -0.96% underlines what a bargain the energy sector is for long-term investors:

Sector Forward P/E Forward FCF Yield Dividend yield Estimated headroom Total return – 2022
Energy 8.5 11.94% 3.77% 8.17% 46%
Financials 11.5 8.59% 2.18% 6.42% -14%
Materials 13.0 6.39% 2.26% 4.13% -17%
Communication Services 14.9 6.52% 1.02% 5.49% -33%
Health Care 15.9 6.35% 1.71% 4.64% -9%
Industrials 16.3 5.57% 1.82% 3.75% -14%
Real Estate 17.4 4.72% 0.00% 4.72% -21%
Consumer Staples 19.9 4.59% 2.70% 1.89% -6%
Information Technology 19.9 4.93% 1.08% 3.85% -25%
Utilities 20.2 -2.07% 2.84% -4.92% 7%
Consumer Discretionary 26.6 3.51% 0.87% 2.64% -22%
S&P 500 16.5 5.22% 1.70% 3.52% -17%
Source: FactSet

The energy sector shines no matter which column is used to sort the table. Here it is sorted by forward price-to-earnings ratio, based on weighted aggregate earnings estimates among analysts polled by FactSet.

The second column shows estimated free cash flow yields, based on current share prices and free cash flow estimates for the next 12 months.

The energy sector has the highest dividend yield of any S&P 500 SPX, -0.96% sector. It also has the highest estimated FCF yield and the most expected FCF “headroom” — an indicator that there will continue to be plenty of free cash that can be used to raise dividends or buy back shares.

So there are the “four reasons” in the headline of this article: lowest forward P/E, highest expected FCF yield, highest dividend yield and most expected FCF headroom.

More about energy: There’s only one ‘perfect asset’ to fight all the bad news that could be coming, says this strategist

“Based on the next several years of free cash flow generation, with the cash plowed into repurchases, 20% of the market cap can be repurchased  on average over the next two to three years” by integrated U.S. oil companies, according to Ben Cook of Hennessy Funds.

Among the integrated oil companies in the S&P 500 are Exxon Mobil Corp. XOM, -1.15% and Chevron Corp. CVX, -1.27%.

Share buybacks at those levels mean drastic reductions in share counts, which can raise earnings per share significantly and add support for higher stock prices over time.

LNG has untapped potential

During an interview, Cook, who co-manages the Hennessy Energy Transition Fund HNRIX, +0.83% and the Hennessy Midstream Fund HMSIX, +0.63%, pointed to the potential for continuing increases in U.S. exports of liquid natural gas (LNG). Europe is now competing with Asia for U.S. natural gas as the supply from Russia has been disrupted.

Cook said that based on projects under development and estimates by the Energy Information Administration, U.S. daily LNG export capacity might increase to 20 billon cubic feet (Bcf) from the current 12 to 13 Bcf by the end of 2025 or in 2026.

But he added that the current projects “are underwritten based on contracts to sell to consumers in China, Korea and Japan.”

“Even with new capacity coming online, it is not as if those units haven’t been spoken for,” he said.

That, along with the uncertainty in Europe, underline what could be a generational opportunity for the U.S. natural gas industry to grow way beyond the expansion in export capacity that was under way long before Russian President Vladimir Putin started building up an army on the Ukraine border in late 2021.

The stage has been set for higher oil prices

A combination of declining U.S. oil inventory and a drop in industry investment in oil exploration and production had laid the groundwork for higher oil prices by the end of 2021:

The chart was provided by Sam Peters, a portfolio manager at ClearBridge Investments, and most recently included in this article on May 11 that included energy stock selections by Peters and other money managers.

The left side of the chart shows that oil industry capital expenditures had increased during previous periods of low supply. The right side of the chart shows that capital spending fell very low last year as inventories were declining.

U.S. oil and natural gas producers have learned from previous cycles, when their focus on building supply led to price declines severe enough to put some out of business and create financial stress for all. During the current cycle, numerous industry executives have noted the importance of giving their shareholders what they want — a combination of prudent investment, higher dividends and share buybacks.

Investing in the energy sector

The energy sector of the S&P 500 is made up of 21 stocks and is tracked by the Energy Select Sector SPDR Fund XLE, -1.43%. The weighting of the index by market capitalization means that Exxon and Chevron together make up 44% of the exchange traded fund’s portfolio, according to FactSet.

The iShares Global Energy ETF IXC, -1.19%   takes a broader approach, holding all the stocks held by XLE but adding exposure to non-U.S. producers, such as Shell PLC SHEL, +0.15% SHEL, +0.32%, TotalEnergies SE TTE, -0.83% TTE, -1.51% and BP PLC BP, +0.06% BP, +0.53% for a portfolio of 48 stocks. It is also concentrated, with the top five holdings making up 47% of the portfolio.

For the non-U.S. companies listed above, the first ticker is for its local company listing, while the second is for its American depositary receipt.

The Hennessy Energy Transition Fund HNRIX, +0.83% held 28 stocks or energy limited partnership units as of June 30. The fund invests across the energy production, transportation and distribution spectrum. It pays out dividend and capital gains distributions annually, in December. Its top five holdings — Plains All American Pipeline L.P. PAA, -0.67%, EOG Resources Inc. EOG, -1.73%, Exxon Mobil, Solaris Oilfield Infrastructure Inc. SOI, -5.78% and Cheniere Energy Inc. LNG, -2.04% — made up about 25% of the fund’s portfolio as of June 30.

The main objective of the Hennessy Energy Transition Fund is long-term growth, with “transition” being the energy industry’s focus on cleaner technologies, including natural gas.

The Hennessy Midstream Fund HMSIX, +0.63% is mainly focused on distributing income from its investments in companies and partnerships that store and transport energy commodities. Its institutional shares have a distribution yield of 10.75%, based on the closing price of $9.60 on Sept. 19 and the quarterly distribution of 25.8 cents a share that the fund has maintained since June 2015, according to Cook.

The Midstream Fund’s top holding is Energy Transfer LP ET, -0.38%, which made up 14% of the portfolio as of June 30. This partnership has raised its distribution twice in 2022.

“They have a number of projects in development,” Cook said.

He pointed to a proposed LNG export facility in Lake Charles, La., which he expects will be under contract by the end of this year.

While the Midstream Fund holds limited partnerships, its own distributions are reported on a 1099 — this means investors don’t have to face the complication of K-1 reporting by limited partnerships.

Don’t miss: It’s a great time to scoop up bargain stocks. Here are 21 examples that could make you a lot of money.

Hear from Ray Dalio at MarketWatch’s Best New Ideas in Money Festival on Sept. 21 and 22 in New York. The hedge-fund pioneer has strong views on where the economy is headed.