What happened

Shares of Wayfair (W 2.08%) were up 17% as of 9:52 a.m. ET on Thursday after the company released a better-than-expected second-quarter earnings report.

The leading online home goods seller reported a 3.4% decline in revenue compared to the year-ago period, but the company saw a return to year-over-year growth in orders delivered, which indicates home goods spending is starting to turn a corner after a year of weak demand.

So what

Wayfair stock was flying high during the pandemic when demand was through the roof. As sales cooled off in 2022 amid high inflation, the stock fell to a cheap valuation of around 0.3 times revenue.

It's not surprising that as the company reports improving sales trends the stock is starting to climb back to its historical trading range on a price-to-sales (P/S) basis. At its current P/S ratio of 0.77, the stock is still below its five-year average P/S multiple of 1.37. 

The 3.4% decline in revenue still reflects a weak home goods market, but it's an improvement over the 7.3% slump in the first quarter and the 10.9% decrease for 2022. Keep in mind that this was a business regularly posting year-over-year revenue growth of around 40% through 2019.

Now what

The next step is for Wayfair to turn its profitability around. Here, too, management had good news. A focus on driving customer and supplier loyalty, as well as lowering costs, pushed the business back to a profit. Adjusted earnings per share of $0.21 was a significant improvement over the year-ago quarter's loss of $1.94 per share. 

With profitability turning around, Wayfair should see substantial growth in earnings and free cash flow once revenue returns to year-over-year growth. Wall Street is already looking ahead to a brighter future, which is why the stock is up 157% so far this year.