The market downturn has been brutal. The Nasdaq Composite index fell 27% over the last year. As frustrating as these steep declines can be, history shows that investors get their best returns by buying stocks when everyone else is throwing in the towel.

While there is no way to know for certain what the markets will do in 2023, there are companies with attractive long-term prospects trading at huge discounts to where they will trade down the road. Here are two discounted stocks trading just above their 52-week low that should deliver market-beating returns in the next bull market.

1. Airbnb

Shares of Airbnb (ABNB 0.87%) fell 47% over the last year and recently hit a 52-week low of $81.91. The stock likely won't stay down for long. Airbnb is experiencing strong business momentum entering 2023 and still has an enormous opportunity to expand over time.

Nights and experiences booked on the platform were nearly 100 million in the third quarter, which drove a 36% increase in revenue over the year-ago quarter. The travel industry has remained very resilient to the economic headwinds impacting retail and other industries, and management didn't report any signs of slowing demand in its last earnings report.

Long-term stays now make up 20% of Airbnb's total gross nights booked. This is consistent with the long-term trend of people spending more money on experiences as opposed to buying things. Management believes the flexibility that people have to live and work from anywhere is a permanent trend that can continue to drive long-term growth. 

In fact, management expects a slowing economy to drive more people to turn to Airbnb to earn extra income. The ability to use Airbnb as supplemental income helps expand the number of choices for travelers, which, in turn, can grow demand.

The company has estimated its serviceable addressable market at $1.5 trillion, and its current growth rate would suggest it certainly has a long runway of growth ahead of it. Because of this opportunity, I would be comfortable buying the stock at its current price-to-earnings ratio of 37. While that multiple represents a big premium to the average stock's valuation of 20 times earnings,  Airbnb's superior record of growth is worth paying up for.

2. Amazon

Amazon (AMZN 0.81%) stock tumbled 45% over the last year and is hovering about 15% above its 52-week low of $81.43. Slowing revenue growth and wider losses on the bottom line have been the main issues weighing on Amazon's stock performance.

But Amazon is one of the best businesses in the world, with dominance in e-commerce and cloud computing services for enterprise. It's only when an outstanding business suffers temporary problems that long-term investors get a rare chance to invest in the stock below what it's worth.

While the company reported a healthy 15% year-over-year increase in revenue last quarter, Amazon's free cash flow has fallen from a peak of $27 billion in 2020 to a negative $26 billion over the last four quarters. 

Part of the collapse in free cash flow can be blamed on higher fuel costs, which have more than doubled over the last few years, in addition to losses from delivering big discounts to customers on Prime Day. The company is also incurring higher costs to produce original content for Prime Video. To help alleviate escalating operating costs, the company recently said it would cut 18,000 jobs. 

But what is getting overlooked is that management is also investing heavily to meet demand in online retail and cloud services. Amazon spent a whopping $43 billion on capital expenditures through the first three quarters of 2022, and that will be a source of higher free cash flow once management lifts its foot off the gas.  

The best time to load up on Amazon stock is when profits fall over an acceleration in the company's infrastructure investments. Amazon has been spending billions to expand its fulfillment capacity and tech infrastructure for years. It's why Amazon is so dominant in e-commerce and leads the cloud services market. It's why Amazon will continue to deliver wealth-building returns for investors for a long time.