While there are still a few trading days left in the year, we have a clear winner among the S&P 500's 11 sectors: energy stocks. It's not even close. Through mid-December, the energy component of the S&P 500 has gained a jaw-dropping 50% this year. That has crushed the index, which has lost more than 16%. The next best sector is utilities, which is up less than 1%.

The rally in energy stocks might not be over. While crude prices have cooled off in recent months on macroeconomic concerns, many analysts see another bull market for oil in 2023.

Here are the sector's best performers in 2022 and why the industry could continue soaring in 2023.

A great year for the oil patch

There are more than 20 energy stocks currently in the S&P 500. Here are the five best performers this year, along with an exchange-traded fund: 

XOM Chart

XOM; data by YCharts.

The leader was Occidental Petroleum (OXY -0.83%), which more than doubled in value this year. The big catalyst was higher oil prices, which enabled Occidental to produce strong free cash flow, including a record $4.2 billion in the second quarter. That gave the company the funds to repay $9.6 billion of debt by the end of the third quarter, achieving its near-term target. Occidental also started returning more cash to investors by significantly increasing its dividend and launching a share repurchase program. 

Occidental's improving financial position led investing legend Warren Buffett to gobble up its stock. Buffett's company, Berkshire Hathaway (BRK.A -0.67%) (BRK.B -0.70%), bought more than 20% of Occidental's outstanding shares. It also received regulatory approval to increase its stake in Occidental to as much as 50% of its outstanding shares. Berkshire also bought a significant stake in Chevron (CVX -0.90%). Buffett's investment in the oil patch likely led many other investors to add oil stocks to their portfolios. 

Two other big winners this year were Hess (HES -1.47%) and ExxonMobil (XOM -0.80%). One catalyst fueling their rallies was their success in finding more oil offshore in Guyana. In October, Hess and Exxon announced two more discoveries, bringing their total to nine this year alone. The partners also said their first two phases of development in the region were operating at capacity and that a third was on track to start up by the end of next year. 

Strong demand for oil and refined products also fueled big gains in refining stocks like Marathon Petroleum (MPC 1.04%) and oil-field service companies like Schlumbeger (SLB -2.01%).

Marathon also benefited from the sale of its Speedway gas station business. It used the proceeds and its surging earnings to repurchase 30% of its outstanding shares. Those catalysts enabled the company to increase its dividend by 30%.

Meanwhile, improving market conditions enabled Schlumberger to capitalize on the strong demand for equipment and supplies by oil companies as they increased their investments to grow production. 

Why energy stocks could have the fuel to keep rallying

Energy stocks thrived in 2022, even though oil prices took a round trip on the year. Crude went from the mid-$70s to more than $100 a barrel following Russia's invasion of Ukraine. However, it went back down into the mid-$70s by the end of the year on macroeconomic concerns. 

Most analysts expect crude prices to rebound into triple digits next year. They point to the end of oil releases from the U.S. Strategic Petroleum Reserve, the gradual reopening of China's economy, and sanctions on Russian oil as catalysts driving crude prices. 

That outlook bodes well for energy stocks. It suggests oil companies will produce gushing cash flows again next year. And they are increasingly likely to return this money to shareholders via dividends and share repurchases. For example, with Occidental Petroleum achieving its debt reduction target, the company said it aims to shift its capital allocation priorities to shareholder returns in 2023. 

Other oil companies will likely pump more cash into investors' pockets next year. Given the economic uncertainty, most energy companies won't boost capital spending much more. Meanwhile, many oil and gas companies have significantly improved their balance sheets in recent years. That leaves shareholder returns as the likely use of the windfall from higher oil prices next year. 

This combination of higher pricing and shareholder returns could allow these companies to rally in 2023. They rocketed this year, thanks to the rise in crude and an increased realization of the importance of fossil fuels following Russia's invasion of Ukraine.

The sector could keep it up in 2023, given the potential catalysts for triple-digit oil prices. So investors should consider adding some energy stocks next year.