What happened

Shares of Trex Company (NYSE:TREX) surged more than 25% by 10:45 a.m. EDT on Tuesday after posting another quarter of record revenue and earnings. Overall, the company's third-quarter results beat expectations on both the top and bottom lines thanks to strong demand and improving margins.

So what

Trex reported that sales jumped 32% to $140 million, which beat the consensus estimate of analysts by nearly $15 million. Driving that increase was a 23% improvement in residential product sales, which rose to $131 million thanks to strong demand as the company continues to take share from the traditional wood market. Meanwhile, the recent acquisition of SC Company, which closed during the third quarter, added $9 million of sales in the company's newly formed commercial products segment.

Lounge chairs on a deck at sunset.

Image source: Getty Images.

Those higher sales, when combined with a 190 basis point improvement in margins in the residential products segment, enabled the company to earn $20.1 million, or $0.68 per share. That blew past analysts' expectations that the company would make $0.55 per share. Further, earnings are up sharply from the year-ago quarter, when the company generated net income of $7.8 million, or $0.16 per share.

Trex's strong showing in the third quarter led FBR Capital to raise its price target from $80 to $96. That said, FBR maintained its neutral rating on the stock.

Now what

Trex's results put it on track to achieve another record year of revenue and earnings, with the company anticipating that sales will increase 17%. Meanwhile, CEO James Cline noted in the earnings release that "recent forecasts point to continued positive trends in consumer confidence and in the repair and remodel market, two key indicators of the strength of our residential business." Add to that the expectation that the company will capture revenue synergies from the recently acquired SC Company, and the company remains optimistic that it can continue growing revenue and earnings at a brisk pace.