Bear markets are painful. That's particularly true for owners of tech stocks, which often endure brutal declines during market downturns.

Tech investors have suffered one of the worst declines in history in 2022. The Nasdaq 100 index, which includes 100 of the largest non-financial companies listed on the Nasdaq Stock Market, is down more than 30% year-to-date. Violent crashes of this nature typically occur just once a decade.

The silver lining? Steep market declines tend to serve up spectacular profit opportunities for long-term investors. And today, you have one such chance to buy shares of two outstanding businesses at steeply discounted prices.

The chipmaker

The semiconductor industry is prone to booms and busts. Advanced Micro Devices (AMD -2.69%) has weathered these economic storms before, and it's doing a solid job of navigating the current market downturn.

Persistently high inflation and the increasing likelihood of a recession are conspiring to reduce demand for chips. Additionally, after growing at a torrid pace during the early stages of the pandemic, when the need to work from home boosted sales of laptops and other mobile devices, the personal computer (PC) market is amid a slump. The gaming market has also cooled as more people have returned to outdoor activities.

These challenges have contributed to a brutal 55% drop in AMD's share price over the past year.

Yet AMD is still on track to grow its revenue in 2022 by more than 40% to $23.5 billion. An impressive lineup of new chips is helping AMD take share from rival Intel in the massive data center market. AMD's acquisition of programmable chipmaker Xilinx, which bolstered its programmable and adaptive computing offerings, is also contributing to its gains.

Better still, the rising usage of cloud computing, artificial intelligence (AI), and 5G networks should result in higher demand for AMD's chips in the coming years. The chipmaker, in turn, is projected to double its per-share profits over the next half-decade.

Yet despite these intriguing growth prospects, AMD's stock is currently trading for less than 18 times its expected earnings in 2023. That's a roughly 18% discount to the forward price-to-earnings (P/E) multiple of the Nasdaq-100 index. It's also a fantastic bargain for a semiconductor leader poised to profit from several powerful technology trends in the years ahead.

The tech titan

The pullback in the PC industry has also impacted Microsoft (MSFT -0.74%). Meanwhile, recession fears are driving many companies to slow their investments in cloud technology. At the same time, uncertainty surrounding Microsoft's acquisition of Activision Blizzard is also weighing on the tech giant's stock.

These factors have contributed to a 27% decline in Microsoft's share price over the past year. This slump might seem relatively benign compared to the steep drop in AMD's shares, but it equates to a staggering $700 billion in lost market value for the tech colossus.

Although these challenges could continue to weigh on Microsoft's results in the coming quarters, the software leader's longer-term prospects remain bright. While some companies might choose to delay their tech spending, a wave of cloud conversions is still slated to occur in the years ahead. According to Grandview Research, the global cloud computing market is projected to exceed $1.5 trillion by 2030, up from $484 billion in 2022. Microsoft currently commands more than 20% of the over $200 billion cloud infrastructure segment of this enormous and rapidly expanding industry, and it's taking market share from its rivals.

Microsoft's cloud-based productivity software, which includes its popular Word and Excel applications, gives it another powerful presence in the cloud market. The tech behemoth's highly regarded AI-powered offerings and cybersecurity services are also expected to enjoy robust demand in the coming decade.

Yet the recent decline in Microsoft's stock price has its shares trading at roughly the same forward P/E multiple (21.9) as the Nasdaq-100 index (21.8). Top-tier, competitively advantaged businesses typically trade at a significant premium to the average index constituent. Yet that's not the case with Microsoft today. You may want to consider taking advantage of this rare opportunity to buy shares in an elite enterprise at a price that's more reflective of an average tech stock.

With its cloud, AI, and cybersecurity services set to fuel its long-term expansion, Microsoft appears set to recover the roughly $700 billion in market value it lost -- and perhaps much sooner than many investors currently expect.