Last week, I mentioned three stocks in the refining and marketing industry that have the potential to crush the market. Today, we'll take a deeper look at one of them: HollyFrontier (NYSE: HFC). And I'm going to show you why this stock is for long term investors.

The metric that I'm interested in
Holly's merger with Frontier last July has proved to be a master stroke. Operations have expanded with refinery throughput capacity going up a massive 91%. While all this sounds good, the question is: From a financial standpoint, did the merger have a positive impact? Delving into the basic numbers, I came up with something quite amazing -- the company's gross refining margins.

Why this metric?
The refining industry is one segment that's been volatile by nature. Depending on fluctuating crude oil prices, supply issues, and the location of refineries, gross margins haven't exactly been overly impressive. Understandably, long-term and risk-averse investors would rather invest in companies operating in the more-dependable exploration and production space. However, it's on this count that HollyFrontier has beaten its peers hands down since the merger.

For HollyFrontier, gross margins in the third quarter of 2011 (the first fully reported quarter since the merger) stood at a record shattering 18.5%. This is the company's highest in the last 15 years!

Strategic advantage
The underlying reason is pretty simple. HollyFrontier took advantage of the Brent-WTI spread brilliantly. And how? By acquiring Frontier's 135,000 barrel per day (Bpd) El Dorado refinery in Kansas, and Sunoco's  125,000 Bpd refinery in Tulsa. An overwhelming 75% of the total feedstock in the two refineries was the cheaper WTI sweet crude oil -- a blend that's been trading at a much cheaper rate compared to Brent. In other words, HollyFrontier obtained most of its raw material cheaply compared to many of its peers.

Also, the company also ensured 100% utilization of those refineries which have access to the cheaper variant. In fact, sweet crude volumes have risen considerably -- to 55% of total processed volumes -- a far cry from 23% in 2008. And not surprisingly, on a compounded annual growth basis, gross margins have reflected this, going up 103% in the last three years!

Bite when there's blood in the water
The general sentiment in the market has been negative. The price fluctuations in crude oil, the delay in the Keystone XL pipeline and the proposed reversal of the Seaway link didn't do much good for the refining industry, which is understandable. In the last six months, HollyFrontier's stock has fallen 24%. Still, in certain ways, I find that hard to justify. Consider this: The Brent-WTI spread rose from $18 to $26 from July to October, and yet the same period saw the stock fall by 32%. This is where I believe the market is overly discounting the impact of negative news.

Dirt cheap
Additionally, the asset value has likely gone up in the fourth quarter. While the stock price fell 33%, the price-to-book ratio plunged to a mere 2.0 from 4.15 in this period. HollyFrontier's assets look undervalued.

The refiner looks cash rich as well. With, a free cash flow of $500 million in the first 9 months of 2011, there's enough room for future expansions or a dividend raise. In fact, management is looking to expand its Woods Cross facility to 45,000 Bpd from the current capacity of 31,000 Bpd. The company has already signed a 20,000 Bpd crude-oil supply agreement for ten years with Newfield Exploration in conjunction with the deal.

With sound fundamentals in place, this refiner does look well prepared to take on this year. To stay up to speed on the top news and analysis on HollyFrontier, you can start here by adding the company to your Watchlist. But if you are looking for more ideas, check out The Motley Fool's latest special report to discover our top stock pick for 2012. It's free, but it won't be available for long, so get your copy now.