Image source: Getty Images.

For value investors looking for stocks that have taken an unnecessary beating, oil refining companies are probably some of the few candidates today. The recent increase in crude oil prices has reduced the price difference between crude and oil products like gasoline and diesel. This has sent shares of refiners in a tailspin this year. Two companies that have taken it on the chin rather hard are HollyFrontier (HFC) and Calumet Specialty Products Partners (CLMT 0.56%)

HFC Chart

HFC data by YCharts.

As the oil refining industry waxes and wanes, it would seem that this would be a great time to buy in. When it comes to these two stocks, though, one could be a decent opportunity, while the other is just waiting to torch your investment dollars. Let's take a look at why HollyFrontier may be worth buying today, while Calumet Specialty Products Partners should be avoided at all costs. 

The case for HollyFrontier

There are a few things that a refiner needs in order to be a good long-term investment: a way to eek out every bit of profit possible from the difference in price between every barrel of crude oil and the refined products it sells, and a management team that takes those profits and invests them in high-return opportunities or returns capital to shareholders. Several refining companies have shown they can do this, but HollyFrontier has proven to be one of the better ones at it.

One thing that HollyFrontier has been able to do better than most refiners is source cheaper, harder-to-refine crude oils and invest in the systems that make it capable of refining these crude types. A refinery's capabilities are measured by the Nelson Complexity Index, which is in essence a measure of the different refining processes at a single refinery. HollyFrontier's Nelson Complexity Index of 12.1 for all of its refineries is the highest rating among independent refiners. This means it can buy crudes that cost less than typical benchmarks and turn a high percentage of the material into valuable products like gasoline and diesel.

Image source: HollyFrontier investor presentation.

What's even better is that HollyFrontier uses those small advantages to generate cash that management invests wisely. Over the past five years, the company has generated a return on capital invested of 15% -- one of the best marks in the industry. And with shares trading at 1.8 times tangible book value -- the lowest in 15 years -- HollyFrontier stock looks pretty attractive today.

Is there even a case for Calumet Specialty Products Partners?

Typically in this kind of format, I would try and argue in some way or another that Calumet Specialty Products Partners is a better buy for someone. In all good conscience, I just can't do it. There are way too many red flags with this company today for anyone, even the most speculative investors among us, to sniff around this stock.

On the surface, the business thesis makes sense. The company is in a part of the oil and gas business -- refining -- that can generate a pretty steady cash stream that can be returned to shareholders. On top of that, Calumet focuses more of its refining on specialty products like lubricants rather than the more typical commodities like gasoline and diesel. It does do some of this, but not like other independent refiners that shoot for these two products to be the vast majority of products sold.

So the story sounds good, but so far the execution has been miserable. The refineries where Calumet generates fuels are typically smaller, less complex operations that don't benefit from the economies of scale of a large refinery with several different refining processes to get the most out of every barrel of crude oil. Only during times when refining margins are extremely high for the entire industry does its fuels segment generate any positive returns. In the most recent few quarters, as refining margins have come back to earth, its fuels segment has been losing money on the company's own adjusted EBITDA (eanings before interest, taxes, depreciation, and amortization) metrics.

If that weren't enough of an issue for Calumet, the company's debt load can only be described as morbidly obese. At the end of the last quarter, the company had a debt-to-capital ratio of 83%, and its net debt to EBITDA stood at more than 14. Companies that are monstrous free-cash-flow generators couldn't even stay afloat with that kind of debt load, let alone Calumet and its rather tepid cash flows.

What a Fool believes

If you are looking at investing in the refining industry, probably the best advice I can give is to avoid Calumet Speicalty Products, plain and simple. There are just too many red flags and questions about the future for this to be anything but a purely speculative investment. Almost any company in this industry would be better. If you actually want to invest in a quality company in the industry, then HollyFrontier is probably one of your better bets.