Our production level loading strategy, which is now completing its first full annual cycle, has allowed us to increase our operating efficiency and enabled us to work even more closely with our pro channel partners, positioning us to respond quickly when Repair and Remodel spend recovers. As we noted in our earnings release today, we are anticipating a muted fourth quarter and have adjusted our production levels accordingly.
Our fourth quarter sales guidance considers similar market sell-through, as seen in the third quarter. Additionally, the fourth quarter is the seasonally lightest period of shipments for decking, railing, and accessories, and we expect that our channel partners will manage their year-end inventory to lower levels than in the prior year.
Looking ahead, Trex is moving forward with strategies to design to capture an increasing share of the conversion from wood to composite decking. In addition to including our popular SunComfortable™ heat mitigating technology and new decking colors to be introduced in 2026, we have new product launches planned for next year that will include features designed to expand our market penetration.
We support this increased level of activity and continue to strengthen the advanced consumer awareness of the benefits of Trex decking and railing. We expect that in future periods, our SG&A spending will return to pre-COVID levels of approximately 18% of net sales. Also, we expect the mix impact associated with another year of double-digit growth in railing and additional depreciation related to the expansion of our Arkansas facility to reduce 2026 gross margin by approximately 250 basis points. Two thirds of the 250-basis point impact is related to depreciation, with the remainder related to mix.
In summary, while this year's sales are coming in below our initial expectations of mid-single-digit growth, 2025 to date has been a year of significant accomplishment for Trex despite market headwinds. I'm confident that our strategy for long-term growth positions us to realize significant gains as R&R spending recovers.
Demonstrating this confidence, our Board of Directors has authorized a $50 million share repurchase program. I'm pleased to ask our new Senior Vice President and CFO to handle the third quarter financial review. Prith Gandhi only came on board a month ago, but he's already making a positive difference at Trex. Prith?
Prithvi Gandhi
Thank you, Bryan, and good evening, everyone. I'm pleased to deliver my first financial review as Chief Financial Officer of Trex. I know many of you already and look forward to reconnecting and getting to know the Trex investors and other analysts who cover Trex.
With that, I'll now review our third quarter 2025 and year-to-date results. Unless otherwise stated, all comparisons are on a year-over-year basis compared to the third quarter and first 9 months of fiscal 2024.
In the third quarter, net sales were $285 million, an increase of 22% compared to $234 million in 2024, driven by growth across product range, which was led by strength in railing as well as the lack of channel inventory destocking that we experienced in Q3 of last year. Gross profit was $115 million, a 23.9% increase from $93 million and gross margin was 40.5%, a 60-basis-point expansion from 39.9% in the prior year. This increase is primarily the result of lower labor costs and production efficiencies from our continuous improvement programs.