Costco Wholesale (COST 1.05%) and Altria Group (MO 0.43%) are both often considered attractive investments during bear markets. Costco's warehouse stores attract bargain-seeking shoppers during economic downturns and lock them in with sticky membership plans. Altria, the largest tobacco company in th U.S., is often considered a stable source of dividends.

Altria might initially seem more attractive because it trades at just 9 times forward earnings and pays a dividend with a massive forward yield of 8.5%. Costco trades at 34 times forward earnings, and its dividend has a much lower forward yield of 0.7%.

A happy couple cheers while using a laptop computer.

Image source: Getty Images.

But over the past five years, Costco has delivered a total return of more than 180%. Altria delivered an anemic total return of less than 1%, compared to the S&P 500's total return of just over 70%. Let's see why Costco outperformed Altria and the market by such a wide margin -- and if it will remain the better blue chip to buy as the bear market drags on.

A positive growth cycle vs. a secular decline

Costco's stock kept climbing because it impressed investors with a simple formula for long-term growth. It kept opening new warehouse stores, gaining new members, and maintaining high renewal rates.

As it expanded, its higher-margin membership revenue enabled it to sell products at paper-thin margins. That strategy fueled a positive growth cycle that consistently widened its moat as the chain opened new stores and gained new members. 

Between fiscal 2017 and fiscal 2022 (which ended last August), Costco's revenue had a compound annual growth rate (CAGR) of 12% and its earnings per share (EPS) registered a CAGR of 17%. It ended the second quarter of fiscal 2023 with 123 million cardholders and 848 warehouses worldwide, compared to 90 million cardholders and 741 warehouses at the end of fiscal 2017. Its worldwide renewal rate also rose from 87.2% at the end of fiscal 2017 to 90.5% in the second quarter of fiscal 2023.

Meanwhile, Altria's stock slumped because adult smoking rates in the U.S. have consistently declined over the past several decades. Its flagship Marlboro brand, which remains the most popular cigarette brand in the U.S., also gradually ceded its dominant market share to its smaller competitors. Between 2017 and 2022, Altria's total cigarette shipments fell from 116.6 billion sticks to 84.7 billion sticks, while its retail market share across the country declined from 50.7% to 47.9%.

Between 2017 and 2022, Altria's revenue (excluding excise taxes) had a CAGR of less than 2%. But its adjusted EPS still had a CAGR of 7% as it raised its prices, cut costs, divested its noncore assets, and spent billions on buybacks.

It's been trying to diversify its portfolio with e-cigarettes, heated tobacco products, and nicotine pouches to counter the secular headwinds, but none of those smaller businesses are offsetting the decline of its core cigarette business yet.

That's why Costco and Altria went in opposite directions over the past five years. Investors saw Costco as an evergreen business, but they saw Altria as a dying one that faced an existential crisis. 

What could happen over the next few years?

Both companies will face some near-term headwinds from inflation this year. Costco's sales of big-ticket items like electronics and appliances have being cooling off, but it's been offsetting that slowdown with its brisk sales of food and household items. Altria, however, expects inflation to throttle consumer spending on cigarettes and its other tobacco and nicotine products.

For now, analysts expect Costco's revenue to have a CAGR of 7% and for its EPS to reach a CAGR of 10% between fiscal 2022 and fiscal 2025. They expect Altria's revenue to have only a CAGR of 1% between 2022 and 2025, but its EPS could still produce a CAGR of 21% as it continues to cut costs and buy back more shares.

Costco's stock seems a lot pricier than Altria's, but it arguably deserves to trade at that premium because it's set up to generate stable growth for decades to come. Altria won't impress the bulls again until it finds fresh ways to boost its sales beyond price hikes. In short, I believe Costco's stock will remain a better buy than Altria for the foreseeable future.