The S&P 500 has been a fascinating wealth-building tool for many years. Its annual returns swing wildly, but it has historically averaged about 10% over the long term.

That might not sound like a lot, which could be why so many people set out to beat the market. However, Warren Buffett once showed hedge fund managers how difficult beating the market can be over the long run.

But that doesn't mean you can't try. Consistently outperforming the index isn't easy, but individual stocks -- especially wonderful companies trading at attractive prices -- occasionally create substantial investment returns.

After looking high and low, here are three stocks that could trounce the S&P 500.

1. Albemarle

The automotive industry is undeniably going electric, and that has investors flocking to companies that make electric vehicles (EVs), but don't overlook the components that EVs need. One example is lithium, a crucial component for the batteries that power EVs. Albemarle (ALB 1.65%) is a specialty chemicals company and one of the world's largest lithium producers.

Strong demand for lithium has boosted Albemarle's business; it's expecting to sell 30% to 40% more lithium this year than in 2022 and could grow at an average of 20% to 30% through 2027. The company signed a supply agreement with Ford that will run from 2026 to 2030, so lithium should lift Albemarle's business for years.

Earnings are poised for a similar growth spurt. Analysts believe the company will earn $25.69 per share this year, valuing the stock at a forward price-to-earnings (P/E) ratio of just 6.6. Estimates call for average annual earnings growth of 11.7% over the next three to five years, which seems achievable if lithium demand hits projections.

The resulting price/earnings-to-growth ratio of about 0.6 signals that Albemarle is a bargain for the potential earnings increases you're getting. Add up an attractive valuation with double-digit growth, and you could get stellar investment returns.

2. NextEra Energy

Renewable energy has become a serious competitor in the energy sector. NextEra Energy (NEE -1.36%) is one of the world's largest green energy producers and utilities.

Years of low interest rates made borrowing cheap, which NextEra took advantage of to invest in its business. That fueled an average of 10% dividend increases and market-beating total returns over the past 10 years.

But sentiment toward the stock has cooled this year. Interest rates have surged, making borrowing more expensive. The company's subsidiary NextEra Energy Partners recently slashed its outlook, citing these rising rates. This spooked NextEra Energy investors, who feared the company will cut its outlook, too, when it reports earnings at the end of October. NextEra stock is more than 40% down from its high and trades near COVID lows from 2020.

So, why might an investor be bullish on NextEra Energy? Well, the selling might be an overreaction. Analysts believe the company's earnings will increase by an average of 8% annually over the coming years, and the falling share price offers investors a 3.5% dividend yield as a starting point for returns.

But this stock will remain riskier because of its exposure to interest rates. The company's long-term growth could slow if interest rates remain high for a long time. Still, the stock's sharp decline makes this proven winner a tempting buy-the-dip opportunity.

3. Tesla

The future of transportation seems electric, something that Tesla (TSLA -1.11%) played a direct role in by pioneering mass-produced EVs. Its leadership has created life-changing returns for long-term investors: Shares are up more than 2,000% over the past decade.

But Tesla's journey seems far from over. EVs are still in the minority on the world's roads, and the looming Cybertruck represents a whole new product category.

The stock isn't a bargain at a forward P/E of 76, and analysts have lowered their earnings projections to average annual growth of 20% due to the company's price cuts on various models. That's a PEG ratio of nearly 4, signaling that the stock's price tag is steep considering its earnings growth.

However, the company is unique in how many additional opportunities it has over the long term. Tesla will likely continue growing deliveries of its existing models; the Cybertruck and Tesla Semi offer new product segments.

It's also a massive player in artificial intelligence, including self-driving technology. And Tesla's energy storage business expanded deployments by 222% year over year in the second quarter. So if short-term returns are anyone's guess, the long-term opportunities point to potentially more market-beating performance in the years ahead.