Stocks have been inching higher again lately, but we know that the good times -- just like the bad slumps -- won't last forever. Market downturns will happen, and the next one could happen soon if the economy continues to weaken or inflationary pressures fail to ease further.  

It's naturally easier to make money during bull markets, but let's look at some investments that could stand out in a bear market. If you have $10,000 to put to work now and want to put it into some stocks that have better chances than most to thrive in a down market, I like Costco (COST 0.16%), O'Reilly Automotive (ORLY 1.57%), and Coca-Cola (KO 0.17%).

Someone pondering a bag of cash as a thought bubble.

Image source: Getty Images.

Costco

The thesis for owning Costco as an all-weather play is obvious to even non-investors. Shoppers know that they get more bang for their buck at its stores, and I'm not just talking about its head-turning $1.50 hot dog and soda combo. Costco's low-cost warehouse club model is all about straddling the line that drives prices lower on one end while keeping its employees well compensated on the other. It's not just the niche. Costco runs circles around the competition.

Costco thrived through the early stages of the pandemic, when its stores stayed open as providers of essential goods. It hasn't squandered that momentum. Business is still booming at the leading warehouse club operator. Stateside comps rose by 9.3% in its latest reported quarter, up a still-healthy 6.5% even if you back out volatile gasoline transactions. Adjusted for the rising dollar, international sales comps were even stronger. 

With the U.S. economy showing signs of strain, you might be concerned about the annual membership fees that Costco charges people to shop in its stores. Unlike the price of the hot dog combo, Costco has bumped up those membership fees on occasion. Its high-margin memberships account for a large part of Costco's profitability. So when belt-tightening is required, one might expect that more cost-cutting customers would be pausing their memberships. Instead, the trend is in the opposite direction. The renewal rate at Costco right now is 92.5% -- slightly higher both sequentially and year over year.

Idiocracy said it best. 

"Welcome to Costco. I love you."

O'Reilly Automotive

Another all-weather winner is a different kind of retailer. O'Reilly Automotive is a leading seller of replacement auto parts. If the allure of that business model doesn't sound very compelling to you, keep in mind that O'Reilly has delivered 30 straight quarters of positive comps. 

When the going is good, folks are willing to spend money on their rides. When the going is not so good, folks have to hold on to their aging cars longer -- and that means investing in auto maintenance. O'Reilly is playing a win-win game, and when you're driving forward perpetually, you find yourself going places. Its 7.6% pop in same-store sales in Q3 -- its latest reported quarter -- is even more impressive when you consider that its per-store results are actually 31.2% ahead of what they were in Q3 2019.

It's not just the streak of comps growth that bears watching here. O'Reilly returns money to its shareholders through stock buybacks, not quarterly dividend distributions. Its share count has declined in each of the past dozen years and has been sliced nearly in half since 2010. 

Coca-Cola

Let's wrap things up with the ultimate pop star. Last year was rough for the market, but energy stocks weren't the only liquid fuel providers that bubbled up during the bear market. Most of the carbonated beverage distributors moved higher in 2022, including Coca-Cola, which gained 11%.

Investors often seek safety in supermarket staples companies as defensive plays, but that strategy can be short-sighted. Sales of many leading food brands slip in tough times as customers can easily replace them with cheaper store brands. Beverage brands -- at least in the carbonated industry -- don't suffer that kind of abandonment. Loyalty is a thing in this niche. Remember the cola wars? A can of Coke or Sprite is a cheap indulgence for an emotionally differentiated product. 

People are consuming fewer sugary soft drinks than they used to, but Coca-Cola has a growing lineup of bottled waters, coffees, teas, juices, dairy products, and even alcoholic beverages to hydrate and energize its customers. Finally, the stock's 2.9% yield may not seem like much right now when some money market funds safely pay interest rates that are even higher, but Coca-Cola has boosted its dividend annually for 60 consecutive years. The hikes keep coming in bull and bear markets.