The S&P 500 had another solid run in 2024, up 25% year to date at the time of this writing. However, there are solid businesses selling at reasonable valuations relative to their long-term growth prospects that could deliver good returns in 2025 and years to come.

Here's why three Fool.com contributors believe Walmart (WMT -1.22%), Nike (NKE -0.68%), and Dollar General (DG 0.34%) are timely buys heading into the new year.

Racing higher with e-commerce

Jennifer Saibil (Walmart): It's been a great year for retail giant Walmart, and it's likely to get even better in 2025. Despite its ubiquitous presence, it's opening new stores, even in the U.S., and it's becoming more efficient. In a new and exciting trend, e-commerce has become a major growth driver, and there are several reasons that is likely to contribute to a booming business in 2025.

One of the advantages of having a business as healthy as Walmart is that it can take its time with innovation. It has a strong, working physical retail model that has little competition. It was slow to enter e-commerce, and Amazon ran circles around it before it eventually got on board. But it has a steady e-commerce business now, and even though it's way behind Amazon, it's still in second place. It also has advantages in its omnichannel platform that even Amazon can't match.

In the 2025 fiscal third quarter (ended Oct. 31), sales rose 5.5% driven by a 27% increase in e-commerce sales. But e-commerce doesn't just mean buying online; it includes services like in-store pickup, which Amazon can't meet. Walmart has 4,600 stores in the U.S., an unmatched distribution network that can get products to customers with quick and efficient delivery or have products available on site. There are always going to be shoppers who prefer to see products before they buy or prefer to pick them up in an hour instead of waiting a day or two (or more).

Walmart is also benefiting from the wider variety of products it can showcase on its website that it wouldn't be able to fit in a physical store. That's bringing in a wider variety of customers as well, including more affluent ones who wouldn't necessarily go to their local Walmart for certain products. Walmart is trying to attract a more affluent clientele, and it recently introduced a new branded-food line with healthier, premium ingredients geared toward this market.

Walmart stock is up 73% in 2024. It's well-positioned with robust growth drivers going into 2025. But more than that, it's a solid, dividend-paying stock that investors can count on for the long haul.

Shares of this iconic sportswear brand are 50% off

John Ballard (Nike): Nike has a long history of delivering solid returns for investors and returning a portion of its earnings to shareholders in dividend payments. However, the recent decline in sales has sent the stock down 57% from its previous peak three years ago.

Nike is in the process of shifting its inventory to be less reliant on classic footwear styles, which seems to be the culprit for revenue misses during the past year amid higher inflation and weak consumer spending. Revenue declined 8% year over year in fiscal Q2 (ended Nov. 30) and is expected to be under pressure for the next few quarters.

As Nike shifts its product portfolio to focus more on sports products, investors should see improving sales. The company is building momentum in sports, with men's and women's running products returning to growth last quarter. Nike also reported strong demand for Kobe basketball shoes, while also seeing strong growth overall in kids' apparel and sportswear.

The stock doesn't look cheap on the basis of earnings. The shares are currently trading at 35 times expected earnings for fiscal 2025 ending in May. But that's largely due to the lower sales and negative impact on profitability as management makes adjustments to inventory. On a price-to-sales basis, Nike stock is the cheapest it's been in a decade.

The high price-to-earnings (P/E) ratio reflects investors' expectation for Nike to successfully complete its turnaround strategy and return to growth under Chief Executive Officer Elliott Hill, who previously worked at the company for over 30 years before coming out of retirement. Investors should see solid returns from these lower share prices over the next five years.

Primed for a comeback

Jeremy Bowman (Dollar General): I'm going to go in a contrarian direction here and predict that Dollar General is going to make a comeback in 2025.

Yes, the discount retailer has struggled lately. In fact, the stock is down 71% from its peak in 2022, pressured by inflation, weak consumer spending, and competition from Walmart. But that has set up an attractive buying opportunity.

Dollar General stock now trades at a P/E of just 12.5, which compares to Walmart's P/E at 38, and Dollar General still retains the competitive advantages that have made the company a success for most of its history.

It has more than 20,000 stores across the country, meaning it has a location within five miles of 75% of the U.S. population, and it's leveraging that position with a new same-day delivery test, in addition to a partnership with DoorDash that covers 16,000 stores.

Dollar General is also making other nuts-and-bolts improvements to the business under its "Back to Basics" strategy, which includes a focus on improving out-of-stocks and ensuring that the checkout areas are appropriately staffed. It's also worked to optimize levels and better streamline its supply chain, opening new distribution centers and closing outside storage facilities.

Additionally, the pain of high inflation is starting to recede, and falling interest rates should benefit both consumers and businesses like Dollar General.

The retailer's sales have continued to grow, but its major challenges have been in margins, which could easily turn around with improved operations. In addition to the cheap valuation, Dollar General also offers a dividend yield of about 3%. The business should start to recover, and there's a lot of upside in the stock given its 70% slide. Recouping those losses would mean the stock would more than triple from here.