After looking at HollyFrontier Corporation's (NYSE:HFC) more-than-10% drop in June, investors might be wishing they'd heeded the old "sell in May and go away" advice. But once you look past the headlines, you'll see that they're misleading. 

What happened

Shares of oil refiner HollyFrontier fell 11.3% in June thanks to weakness across the refining sector. Shares of fellow refiners Valero Energy (NYSE:VLO)Andeavor (NYSE:ANDV), and Marathon Petroleum (NYSE:MPC) were also down between 8.6% and 11.2%, making HollyFrontier the worst performer of the group for the month of June. 

A young man in a suit looks at a large red arrow crashing downward through the ground in front of him

HollyFrontier underperformed its peers in June, but that ignores the larger picture. Image source: Getty Images.

So what

Like most refiners, HollyFrontier's fortunes move with the so-called crack spread: the difference between the cost of unrefined crude oil and the selling price for refined petroleum fuel. Probably the most popular measure is referred to as the "3:2:1 crack spread" because it approximates the product yield at a typical U.S. refinery: For every three barrels of crude oil the refinery processes, it churns out two barrels of gasoline and one barrel of distillate fuel.

June's dismal numbers are partly a result of bad timing. The 3:2:1 crack spread peaked on June 1 at $24.50. It bottomed out on July 2 at $15.00. Refinery stocks tumbled in response. Since then, the crack spread has eased somewhat higher, to about $17.00. If it goes up further, refinery stocks will probably follow along. Certainly, that's what's happened in the past.

Of course, there's no real way to tell whether the crack spread will get wider or narrower. It depends on factors like refinery throughput, fuel demand, and even the weather (Hurricane Harvey caused the crack spread to soar last year, to refiners' benefit). But its range over the past five years has stayed roughly between $10 and $30, and it's very seldom stayed below $15 for any length of time, so further long-term narrowing seems unlikely. 

Now what

Despite the June sell-off, refiners' shares are still up -- way up -- since their temporary low at the beginning of March, with HollyFrontier leading the pack:

HFC Chart

HFC data by YCharts.

Notice that if you'd "sold in May," you might have missed the June sell-off, but you'd also have missed May's big gains. It's also worth noting that as the crack spread has stabilized, so have most of the refinery companies' shares. 

In fact, over the past year, HollyFrontier's shares have absolutely trounced its industry peers, rising 153.2%. The company reported strong first-quarter earnings in April, which contributed to the stock's rise. While it's true that refining is a cyclical industry, trying to time the market isn't the best idea. Smart investors will ignore June's short-term drop and keep their eyes on the larger picture.