The stock market is struggling, but investors shouldn't bet against it in the long run. The S&P 500 may be down 6% in the past 12 months, but over the past decade, it has soared 164% and would have more than doubled your money during that stretch. Investing in stocks that are underperforming and that are good long-term investments, before a bull market arrives, can be a way to set yourself up for some great gains down the road.

Three stocks that are trading near 52-week lows that long-term investors should be eyeing right now are Amgen (AMGN -0.50%)Alphabet (GOOG 0.37%) (GOOGL 0.35%), and Southern Company (SO 1.10%). Here's why you should consider buying these stocks today.

1. Amgen

Healthcare giant Amgen bolstered its business over the past year through acquisitions. In October 2022, it acquired biopharmaceutical company ChemoCentryx for $3.7 billion. Through the deal, the company gains access to Tavneos, a promising treatment for the autoimmune condition ANCA-associated vasculitis. At its peak, Tavneos could generate $1.9 billion in sales.

More recently, in December, Amgen announced an even larger deal to buy rare disease company Horizon Therapeutics for a whopping $27.8 billion. Amgen expects the deal to close in the first half of this year. With that acquisition, it will acquire Tepezza, a drug that treats thyroid eye disease and that has the potential to generate up to $3.9 billion in revenue at its peak.

Last year, Amgen generated $26.3 billion in revenue, with profits totaling $6.5 billion. Adding some potential blockbusters to its portfolio could strengthen Amgen's growth prospects, especially as one of its top drugs, Otezla, faces a loss in patent protection in the years ahead. 

Trading near its 52-week low and at a price-to-earnings multiple of only 19 (the healthcare sector average is close to 22), Amgen could be a solid stock to add to your portfolio today. It also pays an attractive dividend yield of 3.6% that's more than double the S&P 500 average of 1.7%.

2. Alphabet

An underwhelming ad market has made investors bearish on Alphabet's business of late. In the past year, share prices of the tech stock nosedived by 27%. It's trading at around 19 times earnings, which isn't a steep price to pay for a top tech company with assets that include video-sharing platform YouTube and the Google search engine.

There are many great reasons to load up on Alphabet's stock. The first is that even in 2022, amid inflation and a slowdown in ad sales, the company generated year-over-year growth of 10% to $282.8 billion. And on that revenue, it netted a profit of $60 billion, for a net margin of 21%. The business also oozes cash, with Alphabet bringing in just over $60 billion in free cash flow -- the second straight year that it has done that.

Such strong financials put the business in a great spot to invest in Google to help ramp up its artificial intelligence capabilities, or simply to seek out acquisitions to make it a better buy in the long run. Either way, Alphabet's stock trading near its 52-week low is an attractive opportunity that investors shouldn't pass up, especially once a bull market gets going and Alphabet, along with other growth stocks, becomes a much hotter buy again.

3. Southern Company

Down 4% in the past year, Southern Company's stock hasn't exactly taken a beating. But the utility stock should arguably be doing better, given that it offers an attractive yield of 4.4%, which is even higher than Amgen's payout. It should be a safe option for investors right now.

At 19 times earnings, it's another stock that isn't trading at a hefty multiple. Last year, it reported earnings of $3.5 billion, which were 12% of the $29.3 billion total revenue it posted.

Although its operations aren't vast -- Southern serves 9 million customers, with electrical utilities in three U.S. states and natural gas business in four states -- the company has a strong and reliable business that investors can count on for the long term. Its results have been solid enough for the company to have increased its dividend payments for 21 straight years.

As more optimism returns to the stock market, this utility stock could be in much higher demand, given the stability and attractive payout that it offers.