Rite Aid has filed for bankruptcy protection. The pharmacy retailer has struggled with profitability, and opioid lawsuits only exacerbated its problems. Walgreens Boots Alliance (WBA 0.57%) is a larger, more diverse business, but it hasn't been doing all that well, either. Is the company on the same troubled path as its smaller rival?

How the two companies compare to one another

Walgreens Boots Alliance is the larger of the two businesses, but that doesn't necessarily mean that it can't face the same struggles as its smaller rival. A larger business means more locations to manage, and more costs to potentially trim and keep down.

The pharmacy retailers aren't all that dissimilar in their core operations. Both operate with light margins, and both have been struggling to turn a profit.

WBA Gross Profit Margin Chart
WBA Gross Profit Margin data by YCharts.

Rite Aid's margins dipped lower recently, but the trend is nonetheless comparable -- neither business is hugely profitable by any stretch. One thing that does indicate Walgreens is in a stronger position is free cash flow. While Walgreens has normally been in the positive, Rite Aid has been a cash-burning business.

WBA Free Cash Flow (Quarterly) Chart
WBA Free Cash Flow (Quarterly) data by YCharts.

But investors will no doubt notice that in a few of the most recent quarters, Walgreens' free cash flow was just as underwhelming as Rite Aid's was. Walgreens also pays a dividend, which costs the company approximately $1.7 billion over the course of a full year. Rite Aid doesn't have a payout to worry about.

Another metric that Walgreens investors may not love is one that shows the company's quick ratio being concerningly similar to that of Rite Aid's.

WBA Quick Ratio (Quarterly) Chart
WBA Quick Ratio (Quarterly) data by YCharts.

More cuts are coming

Things don't look great for Walgreens. The company is in the midst of a CEO transition. Interim CEO Ginger Graham said that "in just six weeks, we have taken a number of steps to align our cost structure with our business performance, including planned cost reductions of at least $1 billion, and lowered capital expenditures by approximately $600 million."

New CEO Tim Wentworth will have a tough task ahead. Even though Walgreens has already been reducing costs, that still hasn't been enough to steer the business in the right direction. Walgreens reported an operating loss of $450 million for the quarter ending Aug. 31. Its cash and cash equivalents balance has fallen from $1.4 billion a year ago to now totaling less than $730 million. 

In the midst of all this, the company is spending billions on expanding its healthcare business. It's spending money on a dividend that today yields a whopping 9% -- although investors don't appear eager to trust it, as the stock is down 41% in 2023. 

Is Walgreens Boots Alliance too risky to invest in?

Walgreens is an incredibly risky investment to be holding right now. The company needs to take more drastic measures to strengthen its financials. Investors have lost confidence, and rightly so. The dividend most likely needs to go, and the company needs to become leaner if it wants to compete against WalmartAmazon, and CVS Health. It's facing a ton of competition, and diversifying and spending its money on many different avenues could be a recipe for disaster. 

The business isn't about to go under, but it's not in great shape, either. The company can still deploy one move, and that's to stop -- or at least cut -- its dividend. That will improve its cash situation and give it some breathing room. While it's probably not a move the company wants to make, it appears inevitable that it will have to do it sooner rather than later. The declining cash balance is a big concern, and with operations still not profitable after all Walgreens' cost-cutting efforts thus far, it needs to do even more.

For now, investors are better off staying away, as the risk is just far too high to be holding Walgreens' stock or relying on its dividend.