Nowhere has the opportunity been bigger than near Canada, where crude is trading for $43 a barrel below U.S. benchmark prices due to bottlenecks. That is painful for producers there, but highly lucrative for companies with nearby refineries in Canada or the upper Midwest, from Exxon to smaller fuel makers like HollyFrontier Corp.
"U.S. refining has really gone from being a dog to being a fairly attractive business model," John Auers, an executive vice president at consultancy Turner, Mason & Co., said. "I don't think that's going to change any time soon."
Phillips 66, which says it is the largest industry buyer of heavy Canadian crude, operated its nearby refineries at 108% of capacity during the third quarter, earning an average $23.61 a barrel processed there. That helped lift quarterly profits to nearly $1.5 billion, an 81% increase from the same period last year.
Exxon Chief Executive Darren Woods cited the company's access to cheap crude from Canada and West Texas for its refineries as one of the advantages that helped spur it to $6.2 billion in third-quarter profits, its highest total in four years. The company said it can process as much as 500,000 barrels a day of Canadian crude from seven refineries.
"We are seeing the benefits of integration as we capture value from advantaged feedstock from the Permian and Western Canada for our North American refineries," Mr. Woods said.
Much as John D. Rockefeller amassed his fortune by refining crude extracted in the first American oil boom, refiners are once again finding an advantage as the U.S. has become one of the world's largest crude producers.
North American oil production has soared as oil prices have risen over the past two years, increasing 24% to more than 15 million barrels a day in July, according to the U.S. Energy Information Administration.
The rapid growth has overwhelmed existing pipelines and made it difficult for producers to move all their oil to market in areas such as western Canada and the Permian Basin of West Texas and New Mexico. The landlocked oil subsequently trades for far less in those areas than oil shipped via pipelines to major selling hubs such as Cushing, Okla.
Fuel makers with access to the inexpensive crude have reaped the rewards.
BP PLC's underlying quarterly profit soared to $3.8 billion, the highest level in five years, powered in part by the company's massive refinery in Whiting, Ind. The plant, first opened by Rockefeller's Standard Oil in 1889, is capable of running about 320,000 barrels a day of heavy crude from Canada.
Heavy Canadian crude traded for an average $28 a barrel below U.S. benchmark prices during the third quarter, according to S&P Global Platts, while oil sold in the Permian was discounted by an average $14 a barrel. Oil in both regions is expected to remain relatively cheap for at least another year, when new pipelines are set to begin operating.
Permian, heavy Canadian and other similar crudes accounted for about 57% of the oil HollyFrontier processed during the third quarter, the company told investors Wednesday. The Dallas-based refiner posted profits of more than $340 million, its highest third-quarter income since 2012.
Refining companies that missed out on the Canadian trade showed it in their results. Marathon Petroleum Corp. saw quarterly profits decline 18% from the same period last year to $737 million, in part because some of its Midwest refineries were offline for maintenance. The company told investors it is now poised to process about 500,000 barrels of Canadian crude daily. It also expects to benefit in coming quarters from growing discounts on oil from North Dakota's Bakken Shale.
"We kind of see this as a perfect storm," said Rick Hessling, a senior vice president.
Oil in Clearbrook, Minn., one of the trading hubs for Bakken crude, was selling for nearly $13 below U.S. benchmark prices this week, according to S&P Global Platts.
Domestic demand for diesel and other fuel oils remains high, but data from the Energy Information Administration show gasoline demand has fallen off from a year ago as oil prices have risen and refiners have operated at full tilt, boosting stockpiles.
"The real surprise, especially on the gasoline side, is just the very high refinery utilization," said Gary Simmons, a senior vice president for Valero Energy Corp. "You've had about a 2-to-1 increase in production over demand, and it's caused a surplus in the inventory."
The export market has been a key release valve. U.S. exports of refined products topped 5.3 million barrels daily in October, a 33% increase from two years prior, according to the EIA. Top buyers include Mexico, Canada and Japan.
"If you can get your hands on discounted crude oil, you're incentivized to run it and then hope you can find a home for it," said Amy Kalt, a consultant for Baker & O'Brien Inc., an energy consultancy.
Write to Rebecca Elliott at email@example.com and Bradley Olson at Bradley.Olson@wsj.com