What happened

Shares of composite decking company Trex (TREX -2.21%) spiked higher on Tuesday following the release of financial results for the third quarter of 2021. The company's top and bottom lines were much improved from last year and exceeded expectations, which explains the market's enthusiasm today. The stock was up 12% as of 11:45 a.m. EST, hitting an all-time high.

So what

In the third quarter, Trex's net sales increased a whopping 45% year over year to $336 million. Net sales are also up 73% from the same quarter two years ago, as the company continues to take market share away from traditional pressure-treated lumber. In fact, management noted that composite decking materials are now taking 2% market share away from wood annually, compared to around 1% in years past.

Two children lay on a wood deck.

Image source: Getty Images.

Trex did face inflationary headwinds in the third quarter, putting pressure on its material and labor expenses. But as is customary with this company, it was able to manage. For example, higher manufacturing capacity and higher sales helped it offset some higher costs. As a result, its year-to-date gross profit margin of 38.3% is a little lower than its 41.9% gross margin was at this point last year. But that's still strong, all things considered, and it was able to generate $74 million in net income for the quarter.

Now what

Management expects to continue taking market share away from pressure-treated lumber for a long time. Because of this, it announced it's building a new factory in Little Rock, Arkansas. It should open in 2024 and will cost $400 million. It could become the biggest Trex factory in time. Moreover, it will give the company increased capacity in a strategic location. When the factory is complete, it will have manufacturing out West, on the East Coast, and in the Central U.S.

In short, Trex's future is looking as bright as ever.