Phillips 66 (NYSE:PSX) recently reported decent second-quarter results. The energy manufacturing and logistics company earned $550 million, which was up 2.8% from the year-ago quarter. However, what was interesting about that number is how small it was when compared to revenue, which came in at a whopping $24.6 billion. That works out to a slim 2.2% profit margin.

The primary reason Phillips 66's earnings are such a small percentage of revenue is that the company spends billions buying oil each year. Last quarter, for example, the company spent $18.4 billion in buying crude oil and other products that it then refined into gasoline and other higher value products. Meanwhile, over the past year, it has spent more than $70 billion buying oil. To put that into perspective, it's about what the U.S. government spends on education each year. Given that outsized expense, the focus of the company's refining business in recent years has been to gain access to cheaper crudes and make greater quantities of higher-value refined products so it can earn more money on every barrel it buys.

Two oil barrels on top of U.S. currency.

Image source: Getty Images.

The formula for making money on refining oil

The amount of money Phillips 66 spends on oil tends to rise and fall alongside crude prices. For example, in last year's first quarter, the company only spent $11.9 billion to buy oil because prices were lower than they were in this year's second quarter. However, despite that lower oil bill, the company's refining segment only made $86 million in profit that quarter compared to $224 million in the most recent quarter, when oil prices were higher. That's because the key to making more money in the refining sector isn't necessarily spending less in aggregate to purchase oil, but a combination of selling higher volumes of refined products and increasing earnings per barrel.

The industry calls the latter factor the crack spread, which is the difference between what a refiner pays to buy a barrel of oil and the price at which it sells a barrel of refined products. In the first quarter of 2016, Phillips 66's crack spread was $10.64 per barrel, which was the lowest since 2010. However, what's interesting to note is that spreads have continued to tighten over the past year, resulting in the company only realizing a margin of $8.44 per barrel last quarter. That said, the company made more money on refining because it processed higher volumes by improving its utilization rate from 94% in last year's first quarter to 98% last quarter.

Oil Refinery at Sunset with long shadows.

Image source: Getty Images.

Investing for returns

Because refining is a margin business, one of Phillips 66's priorities is to find ways to improve them so it can make more money when market factors squeeze the crack spread. It's currently doing that by investing capital into several of its refineries to increase its capacity to process cheaper varieties of oil and its ability to produce higher-value refined products. For example, the company is modernizing the Fluid Catalytic Cracking Unit at its Bayway refinery in New Jersey by replacing the existing older reactor with modern technology. As a result, the company would be able to produce 4,000 more barrels per day of higher-value gasoline and diesel than it currently produces, enabling it to increase its per-barrel margin. Meanwhile, the company recently finished work on the Vacuum Improvement Project at its Billings refinery in Montana, which will allow that facility to process up to 100% heavy Canadian oil. Given that this variety is cheaper than others, it will boost margins at the facility.

One of the reasons Phillips 66 has focused on investing for returns as opposed to growth is that the refining sector offers limited expansion prospects because gasoline demand in the U.S. is expected to peak next year, according to the latest forecast by Wood Mackenzie. Meanwhile, worldwide demand could top out as early as 2021. That's why most refiners have focused on bringing costs down to improve profitability, especially in the wake of rising oil prices, which could squeeze margins further.

Aside from investing in margin enhancement projects, several refiners have been active in the merger and acquisition (M&A) market in recent years to improve scale and drive down costs. For example, Tesoro and Western Refining recently combined to create Andeavor (NYSE:ANDV). One of the driving forces behind that deal is that the creation of Andeavor should deliver $350 million to $425 million in annual cost savings. Among the synergies is an expected $120 million to $160 million in savings from optimizing domestic and Canadian crude purchases. Meanwhile, PBF Energy (NYSE:PBF) has acquired two refineries in recent years that have increased its scale, which should reduce costs and improve margins. While Phillips 66 hasn't acquired any refining assets, it did finally sell its Whitegate facility in Ireland last year, which it had been trying to unload for years because of poor margins.

It's all about squeezing out more per barrel

Phillips 66 will always spend a significant percentage of its revenue buying oil. Because of that, what matters more for investors isn't its massive oil bill, but how much it makes on each barrel it buys as it turns the crude into something more valuable. That will become increasingly important in the coming years given that oil prices are on the rise while demand appears to be about to peak, which could put more pressure on margins. That could cause the company to look for new ways to boost margins, which might include additional return-focused growth projects, or becoming more active in the M&A market.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.