The bear market is a dark cloud. But it does have a silver lining. And that's the fact that it's giving us the opportunity to buy fabulous companies at bargain prices. These are companies that have demonstrated earnings strength in the past -- and have promising long-term prospects.

The thing about a bear market is it doesn't just hurt struggling companies. It also weighs on the performance of solid companies that could boost your portfolio over the long haul. The stocks I'll mention here have lost 30% to 50% this year. But they have what it takes to rebound -- and thrive over time. Let's check out these three essential bear market buys.

1. Home Depot

Home Depot (HD 0.86%) has slipped 31% this year -- even as the company's earnings hit a major milestone. In the second quarter, Home Depot reported its highest quarterly sales and profit ever. And these figures reach into the billions of dollars. The world's biggest home improvement retailer reported sales of more than $43 billion and net earnings of $5.2 billion.

That's quite an accomplishment considering the pressures of higher inflation and supply chain issues. Home Depot has managed today's supply chain problems by investing in higher in-stock levels and its own new supply chain facilities, for example.

The company also hasn't changed its policy of rewarding investors. In the quarter, it paid out about $2 billion in dividends and $1.5 billion in the form of share repurchases. So, an investment in Home Depot won't only bring you the possibility of share gains -- it also offers you a passive income source.

Home Depot shares are suffering now as investors avoid companies linked to the idea of economic growth. The concern is building projects will slow if economic woes persist.

But here are two reasons to be optimistic. First, Home Depot's professional customers say their project backlogs remain strong. And second, even if projects do slow, that slowdown will be temporary. As we know, times of economic trouble don't last forever.

Today, Home Depot trades for 17 times forward earnings estimates. That's down from about 28 earlier this year. At the same time, revenue continues to rise. This looks like a bargain for a great long-term stock.

2. Etsy

Etsy (ETSY 2.86%) shares have tumbled more than 50% this year. Etsy, an online platform that brings together sellers and buyers of handmade goods, soared during the early stages of the pandemic. That's as consumers stayed home and focused on shopping online.

Today, investors worry that Etsy's best days are in the past. But there's evidence Etsy is just getting started. Of course, the pandemic boosted Etsy's business. It grew from 46 million active buyers before the pandemic to 90 million by the end of last year.

Sure, growth has slowed. But Etsy has managed to keep 88 million of those active buyers. And those buyers are spending as much on Etsy as they did before or slightly more.

Etsy's recent acquisitions of Depop and Elo7 added to employee compensation expenses -- and that weighed on net income in the second quarter. It slipped about 25% to $73 million. But Etsy's overall revenue rose more than 10%. And the acquisitions offer important growth drivers for Etsy down the road. Depop is an online fashion resale marketplace, and Elo7 is a Brazilian online seller of handmade goods.

It's also important to note that Etsy still has a lot of room for growth. If you're like me and shop on Etsy, you may have the impression that everyone knows about this platform. But, in the U.S. and the U.K., 70% of women and 90% of men actually haven't yet shopped on Etsy over the past 12 months.

So, Etsy's revenue is growing and the company is profitable -- and it still has great opportunity to win over more customers. At the same time, the stock is trading at 28 times forward earnings estimates. That's down from about 50 at the start of the year. Considering Etsy's ability to keep shoppers coming back and the room for growth, the stock looks like a steal right now.

3. Amazon

The current economic climate hasn't been easy for Amazon (AMZN 1.30%). The company has struggled with higher transport costs, supply chain challenges, and excess fulfillment capacity. As a result, Amazon's usually stellar earnings reports soured.

For the past few quarters, Amazon has reported declines in operating cash flow and operating income, for example. So why do I favor buying Amazon right now? Because today's troubles are temporary and don't change the overall strength of the business.

Amazon is a leader in two growing businesses: e-commerce and cloud computing. E-commerce is hurting right now. But the overall outlook for e-commerce is positive. Global retail e-commerce is expected to climb by 56% to reach $8.1 trillion in 2026, according to Statista.

As for cloud computing, Amazon Web Services (AWS) continues to grow operating income and revenue in the double-digits. And AWS generally makes up most of Amazon's total operating income. So, it's a key profit driver for the company.

Amazon also is showing signs of progress in the management of today's difficult times. The company said during the second-quarter earnings report that it was controlling costs and improving productivity across its fulfillment network.

Today, Amazon trades at about 2.4 times sales. This is around its lowest level in at least five years. At the same time, revenue continues to climb. So, this bear market price is a very reasonable one for a company that has what it takes to rebound and flourish down the road.