Headwaters' (NYSE: HW) river of revenue and profits was finally dammed yesterday.

Specifically, second-quarter revenue declined 37%, and a $0.59-per-share profit in last year's Q2 became a $0.22-per-share loss this year. Management, meanwhile, cut its full-year earnings guidance from $0.95 to $1.35 a share to between $0.60 and $0.75 per share.

Blame the alternative energy business. Or building products. Or coal. All three units saw lower or flat revenue and earnings. Building products couldn't even manage an operating profit thanks to the housing-led economic meltdown.

But it was the alternative energy segment, which in the past had accounted for the majority of Headwaters' profits, that took the worst beating. Expiring tax credits related to its synfuel business nearly eliminated the need for the division's products. Revenue plummeted 82% as a result.

The good news? None of this has much to do with Headwaters' future prospects. As CEO Kirk Benson told Foolish colleague Rich Smith in October, coal products will likely drive growth over the next five years and alternative energy in the decade beyond that.

Here, "alternative energy" refers to a molecular process called HCAT that transforms unusable heavy oil into light, sweet crude, which is easier for refiners such as Valero  (NYSE: VLO), Sunoco  (NYSE: SUN), and Tesoro  (NYSE: TSO) to process. The demand for light, sweet crude is ever-present and could eventually translate to slick results for Headwaters' bottom line.

There's only one problem. HCAT has hit a snag. Quoting from a company statement:

We introduced HCAT into a third refinery in mid-February. After the trial commenced, a technical constraint arose within the unit and the refinery temporarily suspended the demonstration eight days into the test. During the eight-day trial period, we observed the same positive results previously demonstrated. As of this date, the test has not restarted. We continue to look forward to resumption of the demonstration test, the reintroduction of HCAT and the conclusion of the testing period. [Emphasis added.]

Fingers crossed, then.

Headwaters still holds promise, but only if the hiccups with HCAT halt.

Fuel up with related Foolishness: