What are the magic ingredients required to land one on Jim Cramer's Wall of Shame? Take an idiot-proof quarter where profit is almost assured and turn it into a steaming crater filled with wailing investors. Add in a dash of value destruction -- and mix.

That, at least, was the message from last night's "Mad Money" broadcast, as Cramer declared

Valero Energy

(VLO) - Get Report

CEO William Kleese to be the latest member of the board of the damned.

Here's how he got there: First, on Tuesday, Valero stunned the Street by announcing that it expects to lose about 50 cents a share in the second quarter. Before the announcement, analysts had expected a 73 cent profit.

Let that thought sink in for a moment.

While many expected a healthy profit because, as Cramer said, the oil refinery business should be going gangbusters, the company instead said it will lose money -- a lot of it. The company blamed the catastrophe on a long downturn at their Delaware City and McKee refineries, along with lower margins on diesel and less money coming in from the processing of sour crude.

Last quarter, Valero had beaten the Street in reporting a profit of $309 million, or EPS of 59 cents, against $261 million, or 48 cents per share, in that quarter's year-ago period. But the company had also reported lower revenues, and had begun to talk about the diesel margins and sour crude declines that dotted Tuesday's forecast.

Still, according to Cramer, Kleese took bumbling from a hobby to an art form when Valero announced the company's 40 million share offering this week. On Tuesday, they released the dreadful forecast. On Wednesday, the market responded predictably -- sending shares in the Texas-based oil refiner plummeting nearly 18% to finish at $18.40. And at the end of the day, Valero priced the offering at $18 per share.

Nice work.

In a release, the company said it plans to "use net proceeds of the offering for general corporate purposes, including its capital spending program as well as recently completed and pending acquisitions."

And the topper: These moves comes only after buying back 141 million shares over the past three years at sky-high prices, totaling nearly $9 billion.

But today, Valero is trading in positive territory, along with most of the energy sector. It looks like many investors got past yesterday's bearish crude-oil inventory numbers and moved on to today's better-than-expected jobs data. Valero was changing hands up 32 cents, or 1.8%, by early afternoon.

Last month, the company continued a recent buying binge by entering into a deal to buy a 45% interest in

Total Raffinaderij Nederland N.V.


Dow Chemical

(DOW) - Get Report

. The $725 million deal is intended to give Valero a European foothold, building on international expansion plans.

We'll see how that one works out.

Copyright 2009 TheStreet.com Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.