Oil prices have surged this year, driven by rising demand and Russia's invasion of Ukraine. That's leading investors to consider adding oil stocks to their portfolio to profit from higher crude prices.

These days, two of the more popular oil stocks are Occidental Petroleum (OXY -0.09%) and Kinder Morgan (KMI 0.27%). Here's a look at which is the better one to buy.

The case for buying Occidental Petroleum

Occidental Petroleum has been red-hot this year. Shares of the oil giant have skyrocketed by more than 150%. While higher oil prices have helped fuel that rally, they're not the only factor. Another catalyst is that famed investor Warren Buffett has been buying shares of Occidental Petroleum hand over fist. Buffett's Berkshire Hathaway (BRK.A -0.28%) (BRK.B -0.68%) has taken a more than 20% stake in the oil giant. Berkshire has also received permission to acquire up to 50% of the oil producer's outstanding shares. That has some speculating Berkshire might eventually purchase the entire company. 

Buffett's presence suggests there's a bit of a floor under Occidental's stock price. However, his potential buyout is also a possible ceiling. Further, there's a limit on the amount of cash Occidental can return to shareholders until it starts redeeming the preferred stock Buffett holds that helped fund the company's 2019 acquisition of Anadarko Petroleum.

That deal had been a huge weight on Occidental's stock because of the debt it took on to fund the purchase. However, with oil prices soaring, Occidental is producing a gusher of free cash, which it's using to pay off debt and return money to shareholders through a much higher dividend and a repurchase program. If oil prices remain elevated, Occidental should continue producing lots of cash, easing its financial burdens while it rewards investors. However, if oil prices cool considerably, it could impact the company's ability to generate cash and achieve its financial objectives.

The case for buying Kinder Morgan

While Kinder Morgan isn't in Warren Buffett's portfolio, it certainly fits the mold of a stock he would buy. It's one of North America's largest energy infrastructure companies, with 83,00 miles of pipelines that help transport 40% of the natural gas consumed in the U.S. annually. In many ways, it's similar to Berkshire Hathaway Energy's pipeline group, which owns 21,300 miles of gas pipelines that help move 15% of the country's natural gas. Pipelines tend to produce lots of stable, recurring cash flow, making them excellent income investments. 

Another thing Buffett would love about Kinder Morgan is its valuation. The company expects to produce $2.17 per share of distributable cash flow this year after recently boosting its guidance by 5%, thanks partly to the impact of higher oil prices on its oil production business. While shares of the natural gas pipeline giant are up 20% on the year, Kinder Morgan's recent trading price of around $19 per share implies that it fetches less than nine times cash flow. That's a ridiculously cheap valuation for a company that produces lots of stable and growing cash flow. 

Kinder Morgan uses about half its free cash flow to pay a dividend that currently yields 5.9%. Meanwhile, it uses the other half of its cash to fund expansion projects, repurchase shares, and strengthen its already solid financial profile. The company has several expansion projects underway, including additional natural gas pipeline capacity and building out a renewable natural gas platform. These investments should help grow Kinder Morgan's cash flow, enabling it to continue expanding its high-yielding dividend.

There are lots to like about both energy stocks

Warren Buffett has a long history of investing in the energy sector. He currently owns a large energy infrastructure business and is building a massive position in oil giant Occidental Petroleum. Investors could go either way with the choice between Occidental and Kinder Morgan.

Occidental is the better option for those seeking upside to crude prices because it focuses on producing oil, while crude is a much smaller portion of Kinder Morgan's operations. However, those looking for a deep value play in the energy sector might want to consider Kinder Morgan. It trades at a much lower valuation, which is why it offers a much higher dividend yield. While it's hard to bet against Buffett, Kinder Morgan's combination of value and income makes it look like a much better buy than Occidental in my book.