Financial reports for publicly traded companies indicate some of the country's biggest–and biggest money-losing–building material businesses are moving back into the black, not because of their operations but thanks to the Internal Revenue Service.

The money source is a change in income tax rules affecting the Net Operating Loss carryback provision. Put simply, the provision used to enable a company to apply losses from the current year against profits from the previous two years. But under a change that Congress enacted late in 2009, the carryback was extended to five years, to the middle of the last decade. For many companies in the building material business, that was quite a profitable time.

Builders FirstSource (BFS) used the change to claim $21.1 million in tax benefits in the fourth quarter. As a result, BFS swung to a $6.6 million net profit in the fourth quarter despite racking up a $19.5 million operating loss during that period. For the year, America's No. 8 LBM operation had a net loss of $61.8 million, down sharply from 2008's loss of $139.5 million.

The $6.6 million net profit for October through December 2009 was a marked improvement from the $48.2million net loss in the year-earlier period. It occurred even though sales sank 20.2% to $154 million and the gross margin slipped to 19.7% from a year-earlier 21.5%. Its operating loss of $19.5 million did mark a big improvement from its year-earlier $58.7 million loss.

Dallas-based BFS was able to book $33.2 million in income tax benefits, up from $17.3 million in the final three months of 2008. Of that $33.2 million, BFS says $21.1 million was due to the Net Operating Loss carryback change.

BlueLinx Holdings Inc. took advantage of the same change to help turn a $4.8 million operating loss into a $12 million net profit for the fourth quarter. The Atlanta-based company's return to black ink from a $25.1 million net loss in the fourth quarter of 2008 came despite a 27% drop in revenues to $366.1 million and a 23% fall in the volume of goods shipped.

BlueLinx said it booked a $20.04 million benefit related to the tax refund it anticipates on its 2009 taxable loss. It also recorded a $3.3 million, tax-related non-cash benefit.

Manufacturers also appear to be benefiting from the change. Trex Co. said that a $5.6 million income tax benefit related primarily to the NOL change enabled it to swing to a $1.8 million net profit in last year's fourth quarter from an $11.5 million loss in the year-earlier quarter.