Some well-positioned refinery companies are making a bundle on the cast-off assets of others.

Take

Valero

(VLO) - Get Report

, for instance. Yes, the company has benefited mightily from the record run inenergy prices over recent months. Though crude's latest surge knocked the wind out of the stock market Thursday -- setting off a 7% plunge in Valero's ownshares -- oil's rise has driven a 45% jump in Valero stock this year.

But some observers say that it's more than energy-price inflation that is boosting the fortunes of the San Antonio refiner and marketer.

Notably, the company snatched up a valuable refinery from troubled

El Paso

(EP)

early thisyear. It paid $365 million, or just 15% of the estimated replacement cost, for an asset that boosted earnings immediately. In contrast, El Paso spent nearly twice that amount just to upgrade the refinery -- enabling it to process even the roughest crude oil -- over the past five years.

"Valero is fortunate to acquire this refinery at an attractive price," Valero CEO Bill Greehey said when announcing the deal in February. "What's more,this refinery is a great fit for Valero, because it processes heavy, sour crude oil, which typically sells at a big discount to sweet crude."

The transaction is noteworthy, not just for its salutary effect on Valero. Some observers say the rise in oil prices this year suggests that some sellers of refineries over the last year were all too eager to part with valuable assets.

"El Paso seems to get in and out of businesses at the worst times," said former Coastal executive Frank Powell. "It's like a core competency with them."

Wrong Direction?

By now, El Paso has shed all three of the major refineries it inherited through its 2001 merger with Coastal. Dissidents who last year sought control ofthe company -- many of them former Coastal employees -- claim they would have held on to the refineries through the current upswing instead. They describe therefinery sale to Valero, which is now enjoying record profits, as just another example of El Paso's questionable business decisions.

Most notably, they point out that El Paso landed in trouble -- and began selling off valuable assets -- after placing a misguided bet on energy trading that left the company teetering near bankruptcy.

The company defended its strategy on Thursday.

"Refining was never a core business for El Paso," said spokeswoman Kim Wallace. "It's cyclical, volatile and very capital-intensive. It was just not something the company was going to embrace long-term."

To be fair, El Paso had plenty of company on its way down during the merchant energy meltdown. And at least one other company has shed refineries -- labeling them noncore assets as well -- in an effort to claw its way back up.

Williams

(WMB) - Get Report

has sold two refineries, and like El Paso, it exited the business entirely.

"In hindsight, Williams may wish now that it had not imposed such a narrow definition of what its core operations were," said Tulsa money manager Fredric E. Russell, who has no position in the stock.

Like El Paso, however, Williams expresses no regrets.

"We began to shift away from petroleum and toward natural gas," explained Williams spokesman Kelly Swan. "It was imperative for us to simplify our business mix, reduce our debt and get our arms around the company -- and we've been able to do that successfully over the past two years."

The company certainly lost some strong assets in the process. John Olson, chief investment officer at Sanders Morris Harris, describes Williams' formerrefinery at the North Pole as "one of the most profitable refineries in the world." Still, he says that Williams at least got a fair price for the asset.

In contrast, he says that buyers of the El Paso refineries -- including Valero -- wound up with some good assets on the cheap. He says that El Paso lacked Coastal's "deep bench" of refinery experience after the merger and, suddenly strapped for cash, found itself very eager to exit the expensivebusiness.

"They were happy to find a buyer -- and price was no object," said Olson, who owns stock in El Paso himself. "So Valero got itself a very good,state-of-the-art refinery ... at a very good price."

Profit Machines

It is their broad-based processing ability that sets most Valero refineries apart from those owned by some competitors. Merrill Lynch analyst AndrewFairbanks estimates that some 70% of the oil refined by Valero is sour crude that, right now, costs at least $7 a barrel less than sweet crude. Thus, thecompany gets to pocket this spread along with the high refinery margins -- or the price difference between sweet crude and refined products -- that's beingcollected by others in the group.

Harry Chernoff, an analyst at Pathfinder Capital Advisors, believes that investors are mistakenly lumping Valero in with ordinary refiners. He pointsout that the company's stock took a hit, along with the rest of the group, on this week's news of higher gasoline inventories and lower refinery margins.

But he says that a big chunk of Valero's earnings comes from strong crude spreads instead of the "crack" spreads that determine normal refinery margins.Indeed, he calculates that current crude spreads translate into profits of $5 per share -- or about half the company's expected 2004 earnings -- forValero annually.

"So when the market sells Valero down because crack spreads come down, it's missing a large part of the equation," said Chernoff, who owns Valero stockhimself.

Even Friedman Billings Ramsey analyst Jacques Rousseau -- who's been bearish on refiners for a while -- offers some consent.

"A lot of people miss that," he acknowledged. "That

crude spread is still very strong. ... So some companies have an advantage."

Still, Rousseau isn't comforted enough by Valero's crude spread profits to raise his underperform rating on the stock.

"It's important," he said. "But margins are more important."

Valero's stock, which hit a record high of $78.84 just last month, tumbled to $67.50 on Thursday.

Mixed Calls

In research published on Wednesday, Rousseau noted that refining margins have spiraled 31% so far this quarter -- including a 16% plunge last week alone.

The decline came, he said, even as oil prices rose. He points to gasoline inventories, which recently jumped more than expected, as a bigger driver of refining margins than oil prices in certain periods. And he says that gasoline inventories could rise further during the "seasonally weak" month of September. As a result, he expects refining profits -- and thus refining stocks -- to get hit on weaker third-quarter results.

"I do think the whole sector is going to correct," Rousseau said. "That's been our call for some time now."

But that call, up to now at least, has been wrong. And some question whether refiners can continue to produce gasoline -- and grow inventories -- at their current rate. Chernoff is quick to point out that domestic refiners have been running at up to 97% of their possible capacity. Moreover, he says, gasoline imports have been "running very, very high." In addition, he says, refiners have been lucky to avoid serious forced outages during the recent period.

But he sees changes already. For starters, he says, importing gasoline from Europe has recently ceased to be profitable, so those supplies should "tail off significantly" over the next couple of weeks. Looking ahead, he says, the refinery turnaround schedules for September and especially October havegrown very heavy, and that should seriously pressure domestic production as well.

"So my thinking is that we're nearing the low point in the refined products cycle, where margins aren't going to get a whole lot lower," Chernoff said."I think we stabilize around here and then start to head back up."

Massachusetts investment strategist Peter Cohan expects refineries to keep performing strongly as well. He says that oil prices have clearly driven refinery profits higher so far. And he notes that some people now expect oil to hit $50 a barrel this year.

Cohan, for one, wouldn't be surprised if that forecast does hold true.

"It just seems to me that the forces pushing up the price of oil are unstoppable," he said.

Thus, Cohan expects the current "fear" premium on oil -- estimated at around $15 per barrel -- to at least remain intact. And he wonders whether companies like Williams and El Paso now regret selling "crown jewels" that have started turning huge profits for others.

In particular, Cohan portrays refineries -- which have actually spiraled in number over the past two decades -- as valuable and finite resources.

"They're not making refineries any more," he said. "So they look like absolute gold mines right now."