As investors look for safer, more reliable stocks to hold during what could be more challenging economic time, both Walgreens Boots Alliance (NASDAQ:WBA) and CVS Health (NYSE:CVS) are attractive options. Both are fairly stable healthcare stocks that can be great pillars for any portfolio.

But deciding which one is the better of the two is no easy task. Some of the factors that investors should consider are the changes the pharmacy companies are going through, how they've performed recently, and their overall valuations.

Both companies are revamping their business models

Walgreens and CVS raised some eyebrows this year as both companies announced store closures. Walgreens is planning to close 200 U.S. stores while CVS will close 22 stores in 2020, in addition to the 46 it announced it would close earlier this year. However, the companies aren't shutting down locations because their businesses are in trouble. Instead, CVS and Walgreens are looking to get leaner, cut costs, and change up how their businesses run.

Walgreens is partnering with Jenny Craig to offer weight-loss services in its stores such as meal planning to help assist customers with personalized weight-loss strategies. CVS, meanwhile, will offer other healthcare services inside some of its locations, including assisting recently discharged patients transition once they're out of a hospital's care.

Medical products on a pharmacy's shelves

Image Source: Getty Images.

Both strategies could prove to be effective in bringing more customers into the stores. However, with Walgreens having a big name like Jenny Craig at 100 of its locations, the brand recognition certainly gives the stock a bit of an edge here.

How they've performed recently

When comparing two stocks, it's always important to factor in not only what they have planned for the future but how strong their recent results have been as well.

In its fourth quarter of fiscal 2019, Walgreens failed to show much growth, as sales of $34 billion were up just 1.5% from the prior-year quarter. The company's earnings per share of $0.75 dropped from the $1.55 it earned in Q4 of last year. The company points to the acceleration of its transformational cost management program to explain the increase in expenses during the quarter. Walgreens expects that by fiscal 2022, the program will achieve annual cost savings of $1.8 billion. The company describes the program as "an initiative to reduce costs and increase operating efficiencies" and it's ultimately the reason for its decision to close certain U.S. stores.

CVS reported strong third-quarter results in November, with sales rising more than 36% from the prior-year quarter. However, the primary catalyst behind the growth was an increase in revenue from the company's acquisition of health insurance provider Aetna; the company gave CVS' results a boost this year, but not in the prior-year quarter since the transaction closed in November 2018. CVS' product-related sales, which made up more than 95% of its overall revenue prior to the acquisition, grew to $47.1 billion in Q3, up 1.8% from the prior-year quarter. 

Both stocks have fairly small profit margins, with CVS earning $1.5 billion in Q3 on revenue of $65 billion, or just 2.4% of sales. Walgreens, meanwhile, reported a profit of $677 million on $34 billion in sales, translating to a 2% profit margin. 

With neither company showing a lot of growth, CVS has the edge for its future potential by integrating Aetna over the long term.

Which stock is the better value?

There isn't a whole lot separating these two companies, and valuation can often tip the scales in these cases. Currently, CVS is trading at a price-to-earnings multiple of around 21, while Walgreens' is just 13. Both stocks are trading at around 0.4 times their sales. In terms of book value, CVS is trading at 1.5 times its stated value compared to a multiple of 2.2 for Walgreens. 

Year to date, Walgreens' stock has fallen 15% in value, while CVS' stock is up around 12% and near its 52-week high. From a valuation perspective, Walgreens looks to be the better buy because it also offers a higher dividend yield of 3.1% compared to CVS' payout of 2.7%.

Which stock wins today?

The safer healthcare stock today is Walgreens, but not by a wide margin. The stock is a better value buy than CVS, offers a higher dividend, and has an aggressive cost-reduction program that should make it an even better value in the years to come. CVS could offer some solid growth with Aetna in the fold, but with a federal election around the corner and health insurance being a big political question mark, there's a bit of uncertainty that makes Walgreens a safer bet all around.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.