Tried-and-true candidates for inflation-resistant stocks include consumer staples companies, healthcare businesses, and utilities since demand in these sectors isn't closely tied to the strength or weakness of the broader economy. But another place to look: the companies causing the inflation in the first place.

West Texas Intermediate (WTI) crude oil prices, the U.S. benchmark, just hit their highest point since November of last year. And in the last three months alone, prices are up from below $70 a barrel in early June to above $90 at the time of this writing. The increase is having ripple effects throughout the economy.

Higher oil prices don't just mean higher prices at the pump. Products made from refined crude oil are used in just about every industry. Oil prices are a crucial cost for downstream refiners like Marathon Petroleum (MPC -0.56%), Phillips 66 (PSX -3.71%), and Valero Energy (VLO -0.80%).

However, all three of these downstream dynamos are hovering around all-time highs because they have been able to pass along costs to their customers. Here's why all three of these dividend stocks are worth buying now.

A worker wearing personal protective equipment climbs a ladder at an oil refinery.

Image source: Getty Images.

Follow the supply chain

For nearly two years now, we've heard virtually every industry talk about higher input costs and the pressure to pass along those costs to customers. In a lot of cases, those customers are businesses or consumers.

It's one thing to ask a consumer to pay more for a cup of coffee, a clothing item, or a big-ticket discretionary purchase like a car, and quite another to have petroleum-based input costs increase. The latter is easier to pass along, because making petroleum-based products -- whether it's something as simple as a plastic container or a fender on a car -- is simply part of the manufacturing process.

As an example, Procter & Gamble (PG -0.78%) hasn't stopped making Tide, Gain, or Downy laundry products because the petrochemicals used to make them and their containers have gone up in price. Rather, it has raised its prices and passed along the cost to consumers.

This dynamic puts refining companies in the driver's seat. The closer an industry is to the top of the supply chain, the lower the impact of a commodity that is contributing to inflation. With top refiner stocks, an investor isn't relying on the strength of the consumer, which is a major advantage in an inflationary environment when consumer spending is constrained.

Record earnings, record margins, record highs

In the following chart, you can see that the rise in stock prices of all three companies is paired with a rise in earnings. The question is whether or not these companies will be able to sustain these incredible results or will face a slowdown.

MPC Chart

MPC data by YCharts.

The downstream business is cyclical and depends on myriad factors. But the good news is that earnings could stall or even fall, and all three companies would still be a good value. Marathon Petroleum's price-to-earnings ratio sits at 8.5, while Phillips' clocks in at 5.3 and Valero's is only 4.9.

Driving the earnings growth are high margins. By looking at the operating margins of these companies, we can tell that they are able to pass along higher crude-related costs to their customers, resulting in a net positive for refiners.

MPC Operating Margin (TTM) Chart

MPC operating margin (TTM) data by YCharts. TTM = trailing 12 months.

If refiners weren't able to pass along costs to customers, then we wouldn't be seeing the growth in earnings or margins. So at least in today's dynamic, the old adage that high oil prices are bad for refiners is simply not true.

Rewarding shareholders

The boom in earnings has corresponded with massive stock buybacks from all three companies. Marathon Petroleum is the most extreme example. Over the last 12 months, it has spent a staggering $11.9 billion on buybacks and $1.3 billion in dividend payments. Valero has spent $5.1 billion on buybacks and $1.5 billion on dividends. And Phillips 66 has spent the most on dividends at $1.9 billion and the least on buybacks with $3.5 billion.

To put into context the sheer scale of these buybacks and dividends, consider that Phillips 66 returned 10% of its market cap to shareholders through buybacks and dividends over the last 12 months. In its second-quarter 2023 earnings call, the company said it is on track to return $10 billion to $12 billion to shareholders through buybacks and dividends from July 2022 through year-end 2024.

By comparison, Valero has returned 13% of its market cap to shareholders in the last 12 months, while Marathon Petroleum has returned 21%. You would be hard-pressed to find a company that returned over 20% of its market cap to shareholders in just a year's time.

Buying back a boatload of stock near an all-time high price might look a bit foolish at first glance. However, these are refining companies with limited growth prospects. So there are only so many ways to allocate capital without it being wasteful.

Since all three companies' balance sheets are in decent shape, buybacks and dividend raises make sense. And they are certainly better than overexpanding refining capacity only to open up vulnerabilities during a downturn.

The refining industry is inflation-resistant right now

The soaring stock prices of Marathon Petroleum, Phillips 66, and Valero have compressed their dividend yields down to 2%, 3.5%, and 2.8%, respectively. It's not the same ultra-high yield that investors had come to expect from these companies. But it's still a meaningful source of passive income. And given the market position of the industry, all three companies are set up nicely to keep raising their dividends even if there's an economic downturn or inflation gets worse.

Plus, the buybacks will permanently reduce the outstanding share count of each company, which increases earnings per share and makes each share a better value.

Add it all up, and the refining industry remains a good place to look for safe stocks even though it's been on a massive tear.