Homebuilders are probably breathing a sigh of relief right now, as new housing starts have finally broken to new five-year highs, and many analysts are expressing confidence in a new housing boom. On the other hand, that sound may not be a sigh but a gasp of horror.

My colleague Maxx Chatsko recently wrote about the ferocious pine mountain beetle devastating North American forests. Lumber prices have nearly doubled over the past five years, as the beetle has consumed about 12% of the forested land west of the Mississippi, severely cutting into timber supplies.

As Maxx points out, lumber prices are almost back to their housing-bubble peak, while margins for D.R. Horton (NYSE:DHI) and KB Home (NYSE:KBH), two of the largest homebuilders in the U.S., are still dramatically lower. In 2006, both companies had an operating margin around 15%. Today, D.R. Horton is just half that, and KB Home is barely 1%. Even as increased demand gives these companies some of their pricing power back, they will struggle to make a profit with lumber prices continuing to rise.

It gets worse
While the beetles may be contributing to higher prices on the supply side of things, demand is fueling the fire as well. First, there's the sharp uptick in new housing starts -- an increase of nearly 50% since January 2012. But in Europe, demand is also coming from power utilities. The European Union has set a goal of sourcing 20% of all power generation from renewable sources by 2020, and half of the renewable energy is currently coming from wood, much of it sourced from North America.

Coal power plants can be adapted to burn a mixture of 90% coal and 10% wood, similar in some ways to the EPA's ethanol mandates. The logic is that wood, like corn, is more renewable than traditional fuel sources like coal and oil. Furthermore, trees, and corn, pull carbon out of the air, so the process of growing the fuel source negates some of its carbon footprint.

According to the International Energy Agency, production of wood pellets, commonly used for burning, more than doubled between 2006 and 2010. Despite the surge in supply, prices for wood pellets have gone up 11% since August 2010. For comparison, the price of coal is up only about 3%.

The increased demand is bad for homebuilders, but it's also bad for paper companies. They could at least use the beetle-bored wood that homebuilders don't want, since it would just be ground to pulp and bleached anyway. But with power companies buying up even wasted sawdust, International Paper (NYSE:IP), one of the largest paper companies, has seen its margins compressed, as some operational improvements have been offset by lower sales prices and higher input costs.

The Foolish bottom line
If all these companies are going to be hurt by the declining supply of healthy trees and the rising demand for their wood, who benefits? Timber REITs, basically. While the beetles are damaging their inventory, there are still ready buyers for the wood, whether it's homebuilders, power utilities, or humble paper companies.

Weyerhaeuser (NYSE:WY) and Plum Creek Timber (NYSE:PCL) have seen sales go up almost 20% in the past three years, and margins are strong. Weyerhaeuser and Plum Creek both get a significant amount of their business from the sale of whole logs, manufactured wood, and pulp, making them key suppliers to the increasing demand from different industries. Plum Creek is in a particularly good position, as much of its assets are in the eastern half of the United States, which has been less affected by the beetle.

It's never a good situation when industries are hungry for a resource in the middle of a natural disaster affecting that resource, but it is one investors can profit from. I've spoken before of the benefits of owning timber REITs, and this is an ideal time. Add these companies to My Watchlist to keep an eye on them as the situation unfolds.

Fool contributor Jacob Roche and The Motley Fool have no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.