While investors might think retailing suffers during a recession, many sellers prosper under such conditions by offering necessities at low prices. Cost-conscious consumers flock to such stores.

Such is the case with Costco Wholesale (COST -0.11%) and Dollar General (DG -0.34%). Both offer price points and product lines that perform well during downturns as well as growth periods. The question for investors is which retail stock might serve investors better under current conditions.

Costco

Costco's business has become a standard for reliability. The big-box retailer, known for its low prices, has proved itself able to generate growth in just about any economic environment. Consumers flock to its upscale offerings in good times. When recessions hit, its low-cost necessities sell well.

Despite its massive size, Costco finds new ways to expand. It operates in virtually every large U.S. metro area, and so it expands domestically by entering mid-size regions and opening business centers that serve enterprises. Costco Business Centers are separate warehouses whose product lines cater specifically to enterprises.

It has also performed well internationally, succeeding on four continents by sidestepping the cultural issues that have hindered Walmart and other competitors. A Harvard study cited factors such as memberships, low-cost efficiencies, high-quality products, and worker treatment as reasons for Costco's success abroad.

As a result, for the first nine months of fiscal 2022, sales of $155 billion increased 16% compared with the same period in 2021. Over the same time frame, net income increased 19% to $4 billion because the company held the line on growing operating expense. Given these results, you can understand why Costco has outpaced the S&P 500.

The growth should continue. Analysts forecast earnings will grow by 16% for the fiscal year. But Costco is far from an undiscovered gem. Its price-to-earnings (P/E) ratio of 43 outpaces Walmart, which sells for 27 times earnings. Given this success, it could still beat the market, though some investors might question whether it is worth paying up for at its current valuation.

Dollar General

Dollar General operates over 18,000 "general stores" in 47 U.S. states. Its footprint places it in markets ranging from Manhattan to towns with fewer than 2,000 people. And it plans to add over 1,100 stores this year, indicating that it can continue growing for now.

Dollar General's large footprint gives it pricing power with retailers, allowing it to bring the country's best-known brands at a low cost to a location near most of the country's population. The low prices make it appealing to cash-strapped customers. And its proximity to consumers and its selection help it to undercut convenience stores and grocers.

Nonetheless, Dollar General faces some uncertainties. Without an international footprint, the saturation in the U.S. leads to questions about its long-term future. Also, CEO Todd Vasos will retire in November, and Chief Operating Officer Jeffery Owen will take over. Even though this seems like an orderly transition, such moves breed uncertainty.

For the first half of fiscal 2022, which ended July 29, Dollar General reported revenue of $18 billion, 7% higher than the same period in 2021. But despite the higher revenue, net income dropped 6% year over year to $1.2 billion. The cost of goods sold, along with selling, general, and administrative expenses, increased at a slightly faster rate, placing some pressure on the bottom line.

Still, revenue should pick up as the company expects 11% revenue growth for fiscal 2022. This makes it likely that it should continue to prosper for the foreseeable future, and its 25 P/E ratio makes it slightly cheaper than Walmart and Costco, a factor that will probably work in its favor with some investors.

Costco or Dollar General?

Although both companies may beat the market over time, investors should probably lean toward Costco. Admittedly, Dollar General's lower P/E and success in penetrating almost any market could mean its stock offers more for the money.

However, Dollar General is approaching a saturation point in the U.S., and the ability to expand beyond its home country is unclear at best. If the company addresses this issue, investors should ask again whether Costco or Dollar General will produce higher returns. But as conditions stand now, Costco faces no obvious limitations on its expansion, giving it a better-defined path for long-term growth.