The refinery business has long been the difficult stepchild of the oil industry, expensive to run, prone to accidents and a low-margin headache for executives who preferred drilling for gushers.
But signs of the improving fortunes for the industry can be seen at Valero Energy's Three Rivers refinery here, about 70 miles south of San Antonio at the doorstep of a giant new shale oil field.
Five years ago the midsize operation barely eked out a return from the gasoline and diesel fuel it produced from crude oil, and the company considered selling the plant. It was processing increasingly expensive oil from Africa and the Middle East, and the costs were high to ship it by tanker, unload it in a nearby port and then transport it here by a 55-mile-long pipeline. The price of the refinery's main power source, natural gas, was soaring too.
Now a new drilling boom in South Texas is delivering local crude oil several dollars a barrel cheaper than international prices. Another domestic drilling surge,in natural gas, has produced a 60 percent drop in domestic prices over the last four years. Together those changes have provided the Valero refinery $665,000 a day in savings, raising profit by 400 percent since 2008.
"Three Rivers has gone from a marginal refinery to a crown jewel refinery," said Harry Wright, the Valero vice president who runs the plant. The refinery's reversal is just one example of how the American energy sector is remaking itself as it unlocks vast deposits of fossil fuels in a corridor that stretches from North Dakota to South Texas — and in the process has turned the United States into a net exporter of refined petroleum products for the first time since the Truman administration.
Profits are flowing t most refineries, especially those close to the newly drilled Midwest and Southwest shale oil fields and to Gulf of Mexico ports. Those operations make up roughly three-quarters of the country's refining sector. The refiners are buying up fleets of railroad cars to connect with new shale fields, and investing heavily in new pipeline terminals, storage tanks and equipment to produce diesel for Europe and Latin America.
But the sector has been historically volatile, and some analysts caution that the refiners are vulnerable to any economic downturn, either globally or in the United States, and higher natural gas prices that could be caused by a cold winter.
In the last two years, San Antonio-based Valero, which is the world's biggest independent refiner and has 13 United States refineries, has spent $50 million to improve the Three Rivers plant. It bought 20 acres across the Frio River to build truck transfer stations to unload crude brought from the Eagle Ford shale field just down the road, and it put in new pipelines and equipment to refine that crude.
Spreading across South Texas, the Eagle Ford has been transformed by new drilling technologies from a marginal oil and gas field to one of the fastest developing in the world in just the last four years. Eagle Ford oil production has tripled in the last year alone to 310,000 barrels a day.
And now the pipeline that once brought foreign oil from the gulf port of Corpus Christi to Three Rivers has been reversed, sending Texas crude to other refineries along the coast for processing into diesel and other products for export far and wide, from Mexico to the Netherlands.
The drilling boom has allowed many refiners to buy crude at a huge discount — sometimes $20 or more a barrel — below international benchmark prices. That is especially true for refineries that operate in the core of the country, where there is a glut of crude from the North Dakota Bakken shale formation because of insufficient pipelines. Historically, until the last couple of years, American crudes typically were priced 50 cents to a dollar higher than international crudes.
The price advantage of United States refiners over their foreign competitors helped the country last year become a net exporter of refined petroleum products for the first time since the late 1940s, producing nearly $10 billion in annual revenue from daily net exports of 370,000 barrels a day of gasoline and diesel.
Over the first eight months of this year, according to the Energy Department, those net exports have surged to 975,000 barrels a day. The country may be able to export another half million barrels of diesel fuel over the next few years, according to Thomas P. Barney, chief economist of Marathon Petroleum.
The export boom is particularly welcome because it comes as demand for gasoline and diesel fuel is sluggish in the United States and American refineries have excess capacity to meet local demands. But global gasoline and diesel demand is still growing, and closings of several Caribbean and European refineries in recent years have opened an opportunity.
"Exports are where the growth is, since most people expect domestic demand to be flat or declining going forward," said Anthony Rouse, chief economist at Phillips 66, the global refinery giant. Phillips 66 is planning to increase its United States export capacity by 40 percent by the end of next year, he said.
Still, the refinery comeback does not necessarily mean lower prices at the pump for consumers, since oil prices are determined by global markets. Meanwhile, even the refiners face several potential setbacks. Exports of iesel are vulnerable to a European economic collapse, some analysts caution, and the refineries also face pressure from competitors in emerging markets in Asia, the Middle East and South America.
"We may be peaking out here in the next six to 12 months," said Chi Chow, a Macquarie Capital refinery analyst.
Energy experts note that the refinery business has been prone to expensive accidents, including the Chevron refinery fire in California in August that helped cause gasoline prices to shoot up in some parts of the state to over $5 a gallon for regular grade.
Some critics argue that growing exports are one reason supplies shrank in California, though refinery executives say strong foreign sales guarantee that refineries will keep operating at high capacity, improving efficiency and keeping costs down.
Many companies still view profits from exploration and production in the oil fields as more reliable than those from refining. Several of the largest integrated oil companies, including ConocoPhillips, Marathon Oil and BP, have recently sold refineries or shed entire refining businesses.
HollyFrontier , whose refineries are concentrated in the nation's heartland, where crude oil prices are lowest, showed an increase in net income of almost 150 percent in its latest quarter, year over year, to $502 million.
Michael C. Jennings, HollyFrontier's chief executive and president, estimated that the typical refinery in the central United States had nearly tripled its profit margin for every barrel of refined product sold because of savings in transportation costs and the replacement of internationally priced crude with American shale and Canadian crudes.
"You have an industry that has struggled through time," and has been given new life "because of cheaper access to its principal raw materials, oil and natural gas," Mr. Jennings said. "This industry is being reborn in a manner such that we are consistently making money."
The low natural gas prices are helping all the refineries, even less fortunate ones far from the new oil fields. For Valero, the fall in gas prices since 2008 now accounts for annual savings of more than $1 billion.
The changing economics are reflected in the bustle at Valero's Three Rivers refinery, where workers are busy welding pipes and applying aluminum insulation on a new flash drum, a giant tower meant to process the lighter crudes from the Eagle Ford.
Another truck comes rumbling into the new transfer station every five minutes to bring a total of 45,000 barrels of Eagle Ford crude to the refinery, and a brand new pipeline is bringing in an additional 40,000 barrels a day.
"This is a huge competitive advantage," said William R. Klesse, Valero's chief executive and chairman. "The change in oil and gas production is the biggest thing in my career, and I've been through the Arab oil embargo, price controls, the Iraq-Iran war, the price break in 1986, and the Iraq and Afghanistan wars."
This story originally appeared in The New York Times.