U.S. refineries are expanding their diesel-production capacity, not so much for truckers in the U.S., but for drivers in places like Mexico City and Santiago, Chile.
Already running at their highest levels in six years, U.S. refineries are finding strong demand for diesel fuel, used widely in cars outside of the United States, and other distillates, like jet fuel.
"All these companies are expanding their export terminals- Valero (VLO), Shell (London Stock Exchange: RDSA-GB), Marathon Petroleum (MPC), all of them," said Fadel Gheit, senior energy analyst at Oppenheimer. "Any companies with refining assets on the Gulf Coast are expanding their export terminals...The profitability is not that clear, but the trend is very clear."
The U.S. became a net exporter of petroleum products just two years ago and is now the largest exporter in the world.
The product of choice for export is diesel because the margins are much higher and demand is growing, and U.S. refiners have an advantage over foreign counterparts. Natural gas to fire up refineries is abundant and much cheaper in the U.S., and the expansion of U.S. oil production has made oil more plentiful and cheaper than if refiners had to buy it on the world market. In fact, the U.S., while still the world's largest importer of crude, this year eliminated most imports from Africa.
As of mid-year, margins on U.S. Gulf Coast-produced diesel were running just above $16 barrel, while the margins on finished gasoline were much lower at just under $8 barrel, and that trend is not new. The data were provided by Valero in a recent investor presentation.
So the race is on to add capacity, and mainly for diesel. Diesel demand is growing at twice the rate of gasoline, demand for which has been declining in the U.S. Gasoline demand has been declining and is expected to continue declining, as drivers shift to more fuel-efficient vehicles.
(Watch this: Epperson: Crude oil inventories down 1.32 million barrels )
Valero, the world's largest independent refiner, completed building two new hydrocrackers, one last year at its refinery in Port Arthur, Texas, and another last month in St. Charles Parish, La. Each cost about $1.5 billion and can process 60,000 barrels of petroleum feed stocks a day.
"We're talking about expanding them to make them even larger and we may expand an existing hydrocracker an another existing refinery," said Bill Day, Valero spokesman.
Valero's stated goal is to produce the same amount of distillates as gasoline by the end of 2015 on a one-to-one ratio - unusual for the industry.
Marathon Petroleum this month told Louisiana regulators that, in fact, it is speeding up the expansion of its hydrocracking unit at the Garyville, La. refinery and will complete it in October, a full year ahead of schedule. Marathon will increase the hydrocracker's capacity by 20,000 for production of ultra-low sulfur diesel production, according to Reuters. Marathon is also overhauling a 275,000 distillation unit at the refinery.
Refiners have been pinched as crude oil prices rise, and the narrowing of the gap between U.S.-produced West Texas Intermediate (Exchange:.OWTI-XX) and the international benchmark Brent crude, has taken away some of the advantage U.S. refiners had in the global marketplace. Exxon Mobil (XOM), for instance, pointed to refining margins for part of its surprisingly steep profit decline in the second quarter, and others, like Marathon and Valero, also blamed a contraction in refining margins for reduced profits.
Gulf Coast refineries have had an advantage compared to their counterparts on the East Coast, where a lot of refining capacity has been shut down over the past several years because of their reliance on then much higher priced Brent crude. The addition of pipeline capacity and rail shipments from the middle of the country has brought more U.S. crude into the Gulf, displacing African oil. Rail has also benefited East Coast refiners, who now receive mid-continent crude.
(Read more: China data may wrong-foot oil bears )
"In the U.S., we're importing a lot of fuel and exporting a lot of fuel, and it's geographically different. The imports are going predominantly into New England and the East Coast. The exports are going predominantly off the Gulf Coast," said Andrew Lipow, president of Lipow Oil Associates. "We rarely are shipping gasoline from the Gulf Coast to the state of Maine or Boston. Those imports are being supplied by Canada and Europe. If we were to supply them off the Gulf Coast, we'd need an American flagged tanker to do it, which is expensive. It turns out, it's cheaper to bring those products in from Europe or Canada on a foreign flagged vessel, and then export product off the Gulf Coast to Latin America and the Caribbean."
Government data shows the U.S. exported 1 million barrels a day of diesel fuel for the week ended Aug. 2, about the same as the last several weeks, but up from 840,000 barrels a week earlier in the summer. The U.S. industry has increasingly found foreign buyers for petroleum products, mostly diesel but also jet fuel and some gasoline.
According to Bank of America Merrill Lynch, U.S. exports rose to 2.6 million barrels per day by the end of 2012, from 1.3 million in 2007. Wednesday's data showed exports of 2.9 million barrels per day in the past week. The U.S. imported 700,000 barrels of gasoline per day in the week, while exporting 258,000 barrels a day of finished gasoline.
Valero says it is responsible for about 20 to 25 percent of U.S. exports, and it exports 15 to 20 percent of the diesel it produces, and about 8 percent of the gasoline, Day said. In the second quarter, Valero was producing 1.3 million barrels a day of gasoline and 910,000 barrels of distillates, which include fuel oil, jet fuel and diesel.
(Read more: Energy futures prices)
Fresh data from the Energy Information Administration Wednesday showed U.S. refinery runs at 15.9 million barrels a day during the week ending Aug. 2, down from the more than 16 million barrels a day run in the last month. Refineries continued to operate at a high level of 90.9 percent of capacity, though off recent highs. Gasoline production rose slightly to 9.6 million barrels per day, and distillate fuel, mainly diesel production, increased to 4.9 million barrels per day.
"Export is our safety valve. We cannot make a lot more product that can be sold into the U.S.. Demand is not growing," said Gheit. "The higher capacity utilization, the more efficient the refineries are, the lower the cost to consumers."
The spread between Brent and WTI has narrowed dramatically from $20 to $25 per barrel, to between $2 and $3 a barrel. The prices had even briefly been the same last month. "It should not have gone to $20 and it should not be zero at the end of the day. As we speak, there are refiners that are losing $7, $8, $10 dollar a barrel every day because they have take-or-pay contracts from the mid-continent to the east coast," said Gheit. They didn't count on the jump in U.S. prices, which paralleled draw downs in domestic crude inventories, as the industry ramped up the use of trains and pipelines to move crude around the continent.
Day said the narrowing of the spread between Brent and WTI did take a toll on Valero profit margins, but he said the spread should widen out a bit. "Nobody believed they were going to stay at $20 to $25...We think it will widen back out to $5 to 7," he said. "This is a short-term phenomena."
(Read More: Big oil struggles to reap profits from US energy boom )
Analysts also say U.S. petroleum products are probably slightly more expensive because of the export market, but it's hard to say how much. While refined products can be exported, raw crude oil cannot be.
"If the U.S. did not allow petroleum product exports, you would have much lower petroleum prices here at home. You would lose refining capacity but you would have lower prices domestically and you would have a higher price internationally," said Francisco Blanch, head of global commodity and asset allocation research at Bank of America Merrill Lynch.
"There are a number of reasons that U.S. refiners are very competitive. The fact that crude cannot be exported is one of the reasons," he said. Blanch said refiners are also using natural gas that is less than $4 per million BTUs in the U.S. compared to $10 in Europe or $16 to $17 in Asia.
John Kilduff, oil analyst with Again Capital, said the price of diesel and crude are both higher because of the ability of U.S. refiners to meet some of the demand from abroad. "The U.S. was the bread basket to the world. Now we're the refiner to the world," he said.
Blanch said he expects gasoline demand in the U.S. to drop fairly dramatically over the next 15 as years as drivers switch out of old cars, and new cars become ever more fuel efficient.
"In some ways, it's a good thing the U.S. is exporting this. It is improving the balance of payments of the U.S.," he said. Blanch said the U.S. move toward energy independence also gives the U.S. a growth advantage over Europe and Japan. The latest trade data for the second quarter showed a rise in exports and a drop in imports of refined product, helping to narrow the trade gap.
(Watch this: Santelli: The good news on energy )
"We calculate that it may lead to as much as 1.5 percent of GDP additional output for the U.S. relative to Europe every year, as long as the current natural gas price differential persists," he noted.
Lipow said if there were no exports of refined product, consumers would be paying the price of a less healthy refining industry. "If we didn't export this stuff, we would simply shut down refineries and prices may or may not be higher or lower than they are today, but we would certainly lose capacity. If we were to shut down those refineries, they get shut down forever so if other refineries were offline, there'd be no slack in the system and we would end up with gasoline shortages," he said.
-By CNBC's Patti Domm. Follow her on Twitter @pattidomm.
More From CNBC