Recent headlines might have you believing that you've missed the boat. The market's 20% rebound from its low has some calling this the end of the bear market even though the S&P 500 remains about 9% lower than its all-time high.

Nonetheless, long-term investors can always find good opportunities. These three companies have solid prospects and trade at better-than-average valuations, making their shares worth a good look now.

Five smiling people throwing cash in the air.

Image source: Getty Images.

1. Costco

Costco Wholesale (COST 0.14%) sells memberships that allow people to shop at its warehouses. It gets them to sign up and renew by offering a wide variety of high-quality merchandise and services at low unit prices.

That's why paid memberships keep growing, including by 7.3% year over year to 69.1 million in the latest quarter, which ended on May 7. And the renewal rate was 90.5%, a level it has been hovering around for years.

Costco also has room to grow. Starting the fiscal year with 838 warehouses, it opened 14 during the first nine months (excluding relocations) and plans to expand by another nine before its fiscal year ends in August.

Its operating income slipped by 6.3% in the latest quarter to $1.7 billion due to higher costs, which have affected many retailers.

But Costco's long-term competitive advantages give it the ability to offset higher costs by raising membership fees while keeping its loyal customers, so I'm not concerned. Chief Financial Officer Richard Galanti said recently that the company, which hasn't raised the membership fee in six years, will consider it at some point down the road.

Offering value to customers has been a simple, repeatable formula that Costco has executed to perfection. The stock's price-to-earnings (P/E) ratio of 39 is cheaper than in early 2022, when it was nearly 50.

2. Amazon

Amazon (AMZN 2.48%) has become widely known as an online retailer, but it's much more. It offers low prices online and in physical stores. The company's popular Amazon Prime subscription service includes fast shipping and a streaming service.

There's also Amazon Web Services (AWS), the industry's leading cloud computing service. With steep barriers to entry due to the high cost of building and maintaining data centers, this fast-growing business generates a high margin.

In the first quarter, AWS' sales grew by 15.8% to $21.4 billion although higher costs caused the operating margin to dip from 35.3% to 24%. The lower profitability was partly due to increased spending on technology. Nonetheless, this remains a promising business as companies increasingly rely on data, including generative artificial intelligence, in the future.

All told, Amazon's combined businesses produced 9.4% sales growth to $127.4 billion in the first quarter, while operating income increased by 30.1% to $4.8 billion. Plus, the shares trade at a price-to-sales ratio of 2.5, about half its valuation in the latter part of 2020.

Amazon has become far more than an online bookseller by obsessively focusing on customers. Over the long run, this will likely continue producing outsize gains for shareholders.

3. Ulta Beauty

Ulta Beauty (ULTA 0.78%) offers fragrances and cosmetics to customers with a wide range of budgets. This has proven an effective strategy.

In the first fiscal quarter ended April 29, same-store sales (comps) increased by 9.3% driven by higher traffic, with transactions rising by 11%.

But the average ticket fell by 1.5%, suggesting more-cautious spending by customers. And management ticked down its forecast on operating margin from 14.85% to 14.65%, while maintaining its comps and earnings guidance.

Ulta's long-term prospects -- with the broad shopping experience it offers customers -- remain intact, however. The company plans to open 25 to 30 new stores this year. Plus, Ulta's shares sell at a much more reasonable P/E of 19 today versus over 90 in 2021.

The fact that you can buy shares in these three strong businesses at a lower valuation makes them compelling opportunities.