By Rebecca Elliott
Refining companies typically suffer as oil prices rise because drivers scale back their travel, reducing demand for gasoline and diesel. But record U.S. production, coupled with insufficient pipeline capacity in Canada and West Texas, has depressed the cost of oil in many parts of the country, even as oil prices have been rising in general.
That has boosted margins for many stand-alone refiners, propelling some, including Phillips 66 and Marathon Petroleum Corp., to their highest second-quarter profits on record.
Phillips 66, the largest independent refiner, earned an average of $12.28 per refined barrel during the second quarter, up from $8.44 for the same period last year. The company reported profit of $1.3 billion, up 143% from 2017's second quarter.
Marathon Petroleum earned $15.40 per refined barrel, compared with $11.32 a barrel in the year-earlier period. Its second-quarter profit rose 118% to $1.1 billion.
Both companies seized on the favorable economics by operating their facilities at full capacity.
"Our ability to take advantage of crude differentials provided substantial benefits in the quarter," Marathon Petroleum finance chief Timothy Griffith said.
Valero Energy Corp. reported a refining margin of $10.80 a barrel, compared with $8.66 a year earlier. Its quarterly profit of $845 million marked a 54% rise and its best second-quarter showing since 2015.
Andeavor, which Marathon Petroleum is set to acquire for $23 billion, also posted its best second-quarter earnings since 2015. Its profit of $515 million was more than 12 times that of last year's second quarter, with its refining margin rising to $14.26 a barrel, from $9.45 a barrel.
Distribution pains associated with rapid production increases have played to refiners' advantage. Benchmark crude prices in the U.S. fell to as much as $11 a barrel below international prices during the second quarter, the widest spread in three years, according to Dow Jones Market Data.
The discount on oil sold in Canada and West Texas, home to the Permian Basin, the U.S.'s most active oil field, was far steeper because of regional pipeline bottlenecks.
That was a boon for sellers of refined products, which are typically priced to the global market. The U.S. was exporting daily about 3.4 million barrels of refined products, including gasoline and diesel, as of May, according to the Energy Information Administration.
"They're in the catbird seat as far as buying their raw materials," said Sandy Fielden, director of oil research for Morningstar Inc., who called refining a "cash cow."
American refiners are the grunts of the energy industry, largely operating fuel-making facilities that have been in place for decades. But during the shale boom their stocks so far have outperformed other sectors of the oil and gas business.
The four largest stand-alone refining businesses in the U.S. -- Phillips 66, Valero, Marathon Petroleum and Andeavor -- have produced the highest stock returns among energy companies on the S&P 500 index since April 2012, when Phillips 66 was spun off into an independent company.
The businesses benefited in the early days of the shale boom from a U.S. ban on crude exports that depressed domestic prices, giving them an edge over foreign competitors.
Some expected the companies' fortunes to wane after the U.S. lifted the export ban in 2015, causing the price differential between domestic and foreign crude to shrink. The recovery in oil prices following their crash in 2014 was seen as a potential headwind, too.
But bottlenecks and rising production have continued to create buying bargains for refiners. Those discounts are expected to widen over the coming year as production in Canada and the Permian Basin continues to overwhelm existing pipelines, analysts said.
"It's going to recur in coming quarters," Doug Terreson, an analyst with Evercore ISI, said of refiners' performance.
An economic slowdown could of course tamp down demand for gasoline, drying up refiners' profits. Another factor, Mr. Fielden said, is political change in Mexico, where energy reforms proposed by the country's president-elect could reduce demand for U.S. exports.
Longer term, an international air-pollution rule to cut emissions from oceangoing ships is poised to boost U.S. refining companies, particularly those with more technologically advanced facilities on the Gulf Coast and in the Midwest.
Set to go into effect in 2020, the regulation by the International Maritime Organization is designed to reduce the amount of sulfur in marine fuel. Most large vessels now run on a high-sulfur fuel known as bunker fuel, which is made from the leftovers of the diesel and gasoline refining processes.
Valero Chief Executive Joe Gorder told investors he expects the regulation to benefit the company. "We should see significant increases in our free cash flow," he said.
Write to Rebecca Elliott at email@example.com