Oil prices are rising.

Both Brent Crude and West Texas Intermediate Crude spot prices have been trending higher since last summer, and they've been taking some oil companies' stock prices along for the ride. if you're looking for bargains in the oil and gas industry, good news! There are still bargains to be found, although they aren't as plentiful as they were a few months ago. 

But investors looking for an incredibly cheap oil or gas stock should take a look at Apache Corporation (APA -1.26%)Hess (HES 0.45%), and Kinder Morgan (KMI -0.32%).

A series of pipelines of various sizes

These beaten-down oil and gas stocks are bargain buys. But they may not be for long if the stock market rises. Image source: Getty Images.

Poised to outperform

Independent oil and gas exploration and production company Apache Corporation managed to disappoint investors in 2017, so much so that its stock dropped 33.5% for the year. This was mostly due to declining production volumes and lowered production guidance, as well as a Hurricane Harvey-related delay in getting the company's new Alpine High play in West Texas up and running. 

Still, some of these issues are temporary; the hurricane delay should be resolved by the end of the first quarter of 2018, at which point oil and gas can start flowing in earnest from the promising Alpine High. The company predicted that production volumes would decline through the second quarter of 2017 and then begin to rise again in the Q3 2017, and that's exactly what happened

But most importantly, the company now has more cash, less debt, and higher profitability than it did a year ago, and oil prices are much higher now than they were then. Yet the company's stock is still trading at about a 30% discount to its year-ago price. That looks like a bargain waiting to be snatched up to me!

Stability in the storm

Speaking of companies that disappointed investors in 2017, shares of Apache's fellow exploration and production company Hess finished the year down 23.8%. So, not quite as bad as Apache, but definitely not good. 

And yet, Hess has some advantages over its peers. It sports a top-notch balance sheet, particularly given the sector in which it operates. Oil drillers like Hess and Apache are notorious for carrying heavy debt loads, but Hess has managed to keep its debt-to-capital ratio to 33.8%, among the lowest in its peer group. Apache's is far higher, at 54.8%.

Hess also has some exciting growth opportunities. It's added two rigs to its major position in the Bakken Shale and is a partner with ExxonMobil on an incredibly promising offshore project in Guyana. It has divested underperforming assets in Equatorial Guinea and Norway to little fanfare. And although it isn't cash flow positive at $50/barrel of oil yet, it plans to be by 2020.

If oil prices continue to rally, Hess will be in an excellent position to grow its business and reward investors.

Holding a grudge

The market was justifiably upset with pipeline operator Kinder Morgan in 2015. The company slashed its quarterly dividend by 75%, from $0.50/share to just $0.125/share. Investors left the stock in droves, knocking down its value by nearly two-thirds, from just under $45/share to just under $15/share. The stock has risen about 26% since, and now trades for about $19/share. But that looks like a bargain given recent announcements by the company.

In July, Kinder Morgan announced its intention to declare an annual dividend of $0.80 per share for 2018, a 60% increase from the expected 2017 dividend. The company also announced plans to increase its dividend to $1.00 per share in 2019 and $1.25 per share in 2020. Finally, Kinder Morgan announced plans to implement a $2 billion share buyback program.

Since the first dividend increase is expected to be the Q1 2018 dividend, you'd think investors would jump into the stock. Well, they bid shares up by about $1.00 in the immediate aftermath of the announcement, but then knocked them down 12.1% over the rest of the year. 

Given that Kinder Morgan has a strong business, a huge asset base, and a very favorable market outlook, the fact that investors are giving the stock the cold shoulder could be a case of "once bitten, twice shy." But there's really no need for investors to be shy of Kinder Morgan at these prices.

Run, don't walk

Investors looking for bargains in the oil and gas industry are going to find slim pickings that will keep getting slimmer as energy prices rise. But taking a closer look at Apache, Hess, and Kinder Morgan is a good idea.

That said, don't look for too long -- the stock market is already sending these shares higher. Shares of Apache and Hess are already up by double digits since mid-December, and even Kinder Morgan's stock has ticked upward. Certainly, do your due diligence, but just be aware that these stocks may not be cheap for long.