When a company's quarterly profits drop 18% year over year despite record sales for its primary product, you know you need to dig deeper into the earnings report to find out what went wrong and what it means.

I did that for CF Industries (CF 0.54%), and I found out that it was the higher cost of the key input, natural gas, that hurt CF's profits. As an investor, you may find that reason enough to raise a yellow flag, but hold on: CF's second-quarter earnings report revealed important factors that might even compel you to add the stock to your portfolio.

CF's nitrogen complex at Donaldsville is also North America's largest. Image source: theadvocate.com

When a drop looks good
While a shrinking top line can never be a good thing, CF still deserves the accolades for delivering the smallest drop in revenue among the leading fertilizer companies during the last quarter. CF's second-quarter revenue was just about a percent lower, year over year. Comparatively, PotashCorp (POT) and Mosaic (MOS 1.64%) reported 11% and 5% drops, respectively, in their last-quarter revenues. Agrium (NYSE: AGU) was the only company to deliver 4% growth on the top line in its last quarter, but all those gains came from its seeds and crop protection products business. Agrium's wholesale division, which constitutes fertilizers, reported a 9% fall in revenue.

These numbers prove CF's resilience in an otherwise volatile business, and its stand-out performance can be entirely attributed to its nutrient mix -- CF derived 89% of its revenue from nitrogen products in Q2. Phosphate made up the remaining portion.

None of the other companies mentioned above rely as heavily on nitrogen as CF does. While PotashCorp and Mosaic specialize in potash and phosphate nutrients, Agrium isn't strictly a fertilizer company.

It's an advantageous business model
So what makes nitrogen so advantageous for CF? The most obvious reason is that nitrogen is the most essential nutrient for corn, which results in a relatively inelastic demand for the nutrient. Moreover, as compared to potash or phosphate, nitrogen is absorbed faster by the soil, making it necessary  to reapply the nutrient every time a new crop is planted. These two factors ensure that CF's nitrogenous products have enough takers at almost all times.

Consistent demand has also resulted in firm prices of nitrogen products over the years, unlike those of potash and phosphate. What's more, potash prices are staring down the barrel after the recent shake-up in the fertilizer industry, which works in CF's favor; unless, of course, farmers suddenly take to potash over nitrogen in the wake of lower potash prices. But that's unlikely, given the critical dependence of corn crop on nitrogen.

It looks like CF can't go wrong with its specialization in nitrogen products, as evidenced by its solid second-quarter performance when revenue from its nitrogen division hit a record high of $1.5 billion. Investors should be happy.

Flexibility that counts
CF's second quarter was yet another proof of how efficiently the company monitors and changes its product mix to suit the present market conditions. CF deals in several nitrogen products, such as urea, ammonia, and urea ammonium nitrate, or UAN.

During the last quarter, CF's urea selling prices fell sharply by 26% year over year as farmers deferred application on cooler weather conditions even as cheaper urea products from China flooded the market. Given that urea constituted nearly 20% of CF's total sales volumes during the quarter, the company's top line could have taken a hard hit. Thankfully, that wasn't to be.

To offset lower urea prices, CF focused on selling higher amounts of ammonia, the prices of which had risen nearly 11% year over year. So while CF maintained its urea sales volumes at last year's level, it increased ammonia sales by 5% during the quarter.

Likewise, CF kept the proportion of UAN in its total sales mix steady at 45% to exploit the firm prices of UAN. In fact, CF increased the production of UAN by 5%, year over year, during the second quarter even as production volumes for all other nitrogen products declined year over year. That's because UAN generates high margins, and has thus captured CF's attention.

High UAN profitability even encouraged peer CVR Partners (UAN 1.46%) to convert a whopping 97.5% of the ammonia it produced to UAN during its last quarter. The strategy worked, reflecting as an 8% year-over-year growth in the company's top line.

So every time CF's management talks excitedly about UAN, investors should know where that's coming from. The company's flexibility to adjust production helps it negate price shocks to a great extent, which, undoubtedly, is a huge advantage.

Ready to count your checks?
Operational metrics aside, perhaps the most important takeaway from CF's second-quarter earnings call for investors was the company's views on generating value for shareholders.

CF's management is weighing what would be the best option to return cash to the company's shareholders. In all probability, it means greater dividends could be on the way. Until now, CF advocated share buybacks, returning an impressive $1.1 billion in repurchases year to date.

Meanwhile, CF has been stingy with dividends, paying out just 5% of its profits. At current share prices, CF yields a dismal 0.80% dividend yield. Compare that with PotashCorp's handsome 4.8% dividend yield, or with Mosaic's and Agrium's similar yields of 2.4%, and CF turns out to be the worst option for investors looking for some secure income. That might change soon, and investors should keep an eye.

Foolish takeaway
The price of natural gas is an uncontrollable, as well as an unpredictable, factor. While CF can't do much about it, the company's business model is strong enough to fuel excellent growth should gas prices weaken. I think it's time for investors who have sidelined CF Industries' stock to rethink their decision.