What's ailing Walgreen (WAG, news)?

The nation's largest pharmacy has run into a competitive wall that's hard to miss if you're a shopper or a shareholder.

First, many faithful customers whose families have shopped at the retailer for generations have learned over the past few months that they can no longer fill their prescriptions at Walgreen's -- at least, not if they want their insurance to cover it.

Second, Walgreen shareholders need a prescription for pain relief. Despite the stock market's recovery, Walgreen shares are down 24% since trouble began last summer.

What's the problem?

In short, behind the scenes there's a big-money battle playing out in the pharmacy world that could change where you get your prescriptions filled. It is reshaping who profits from the huge prescription drug industry. And Walgreen, a storied brand and part of Americana, is at the center of it.

Here's a look inside this the prescription drug fight, and how it might turn out for Walgreen -- which is, after all, the sort of iconic stock that investors often do well buying when down, because the name helps it bounce back.

image: Michael Brush

Michael Brush

The contestants, old and new

In one corner, you have Walgreen's, which has been filling prescriptions since 1901. Over more than a century, it has become one of America's favorite retailers.

In the other corner, you have the relatively new middlemen of meds known as pharmacy benefits managers, which got started in the 1980s. PBMs pool the health insurance needs of private companies, governments and unions to increase their bargaining power with drug companies and lower the cost of medications.

They also bargain with pharmacies to determine whom to invite into their networks -- and at what share of the proceeds. And one in particular, Express Scripts (ESRX), has been squeezing Walgreen.

Last summer, Express Scripts offered the chain a much-less-favorable revenue split than it was used to. Walgreen declined. Shortly after, things got worse for the drugstore chain when Express Scripts announced plans to merge with Medco Health Solutions (MHS). That's another large PBM, and another huge Walgreen partner.

Seeing the writing on the wall -- the potential loss of both Express Scripts and Medco customers when contracts with Walgreen eventually expired -- investors fled Walgreen stock over the summer. From a peak above $45 in May, shares traded into the low $30s.

After that, the stock drifted in the $32 to $34 range as investors braced for what was about to happen: the expiration of Express Scripts' contracts with Walgreen at the start of 2012.

This year, Express Scripts has been shifting customers to other pharmacies -- which means they can no longer have their prescriptions filled at Walgreen's if they want insurance to cover them. If the Medco merger goes through, the same may well happen with Medco customers.

This battle has scared investors and Wall Street analysts away from Walgreen stock. But that makes it an intriguingly inexpensive -- if somewhat risky -- contrarian play. The bottom line is that even though things look bleak, Walgreen has the strength to fight back.

"Walgreen is a top pick," says Andrew Wolf of BB&T Capital Markets, one of the few Wall Street analysts with a "buy" rating on Walgreen stock. Walgreen stock trades at a 20% to 30% discount to CVS Caremark (CVS) and Rite Aid (RAD) by some valuation metrics, he says. "Most of the bad stuff is priced in. If anything good happens, the stock is going up." Wolf has a 12-month price target of $46 on Walgreen stock, which recently traded for about $34.

How Walgreen could win

What could go right from here? Analysts cite three things.

1. Walgreen uses its clout to fight back.

Walgreen still has many strengths, starting with decades of customer loyalty and a huge presence on the retail scene. It fills 21% of prescriptions in the U.S. It is such a fixture in some places, including its home turf of Chicago, that customers refer to it as "my Walgreen's."

Click here to become a fan of MSN Money on Facebook

Walgreen could well draw on that customer loyalty to turn the tables. If enough Walgreen's customers complain about being forced to go elsewhere, and the employers who work with Express Scripts and Medco sound off, too, the PBMs would find themselves in a tough spot.

Thus far, this isn't happening. Since Walgreen and Express Scripts parted ways at the start of the year, Walgreen has retained far fewer pharmacy customers than it said it might.

But here's the catch. A lot of those customers -- employers, unions or governments -- have contracts that prevent them from immediately leaving Express Scripts so their workers can stay with Walgreen's, says Walgreen spokesman Michael Polzin. The real test will come this spring and summer, which is renewal season for PBM contracts, he says.

"As we enter the PBM selling season, you are going to have one PBM, Express Scripts, out there selling without the nation's largest drugstore chain in their network," says Polzin, referring, of course, to his own company. "Virtually all the other PBMs will be out there selling with the nation's largest drugstore in their network. We will see who has a better success."

The idea that Walgreen has enough muscle to score big victories against Express Scripts over the next six months is not so unlikely.

Founded in 1901 by Charles Walgreen, the eponymous drugstore chain grew rapidly with innovations like brighter lighting, wider aisles, friendlier service and expanded merchandise offerings. In 1927, the company went public. By 1960, it had filled 100 million prescriptions, more than any other drug chain.

Now it handles more than 800 million prescriptions a year through 7,840 stores. It had $72.2 billion in sales last year, two-thirds of that from pharmacy sales. Walgreen is particularly strong in several regions, with huge market share -- and clout -- in areas including Texas, Florida and San Francisco. It has also appeared on Fortune magazine's World's Most Admired Companies list for 18 years running.

In short, Walgreen has some weight to throw around.

And -- according to Walgreen-sponsored studies, at least -- most employers and their insurance companies (known as "payers") would want to see 5% or so in savings in exchange for offering their employees a smaller pharmacy network without Walgreen. "We don't think payers are interested in restricted networks unless there is real substantial savings. And those savings have not been offered to date through restricted networks," says Walgreen's Polzin.

"Most payers don't want narrow networks," agrees Wolf. That's one reason he is bullish on Walgreen stock. Scott Mushkin, an analyst with investment banking group Jefferies, says that in an early February meeting with the company, Walgreen execs predicted the chain will retain at least two-thirds of Medco business even if the merger with Express Scripts goes through.

2. Regulators could block the Express Scripts-Medco merger. The Federal Trade Commission has concerns about the concentration of power among PBMs that will result from this merger. The FTC was expected to rule by now, leading many to conclude it won't block the deal. But Morningstar analyst Matthew Coffina says there's still a 40% chance the merger will be blocked. If so, Walgreen stock "is going right up," says Wolf. Another possibility: The FTC could impose restrictions on Express Scripts-Medco that help Walgreen.

3. Walgreen could make a dramatic move to raise its clout -- by getting bigger. Rite Aid stock advanced sharply last week on speculation that Walgreen would buy it. Coffina doubts that Walgreen would purchase the whole chain. But it could buy Rite Aid stores in regions where it is weaker, such as the Northeast and Southern California, says Credit Suisse analyst Edward Kelly.

A more dramatic option would be a marriage between Walgreen and CVS, the two giants of the drugstore space, says Coffina. That's admittedly a long shot. But with PBMs getting bigger, a Walgreen-CVS merger would go a long way toward improving the bargaining power of these drugstores so they could defend their profit margins, says Coffina.

If antitrust regulators give the green light to an Express Scripts-Medco merger, it could be tough for them to put up roadblocks to mega-marriages in the pharmacy space -- even between two giants like Walgreen and CVS.

Many analysts see Walgreen as vulnerable, of course, which is why the stock is cheap. While Walgreen's stores fill 21% of scripts in the country, for example, they do it with only 13% of the pharmacy counters, points out Kelly, at Credit Suisse. "We are convinced that PBMs are in the stronger position," says Coffina. "Their clients are willing to walk away from a pharmacy chain even if it will save them only a modest amount of money. We are not enthusiastic about Walgreen."

Click here to become a fan of MSN Money on Facebook

So who ultimately wins? We'll know a lot more by Labor Day -- after the contract renewal season between employers and PBMs this spring and summer. If you're going to invest, be aware of that timeline.

I'll side with Walgreen and Wolf, the BB&T analyst who is bullish on the stock. After all, as Apple (AAPL) has demonstrated, customer loyalty is a powerful force in retail. And loyalty to a 111-year-old store likely runs deeper than loyalty to a company you know only because your employer has hired it to handle part of your health plan.

Stocks mentioned in this article: Walgreen (WAG, news), Express Scripts (ESRX), Medco Health Solutions (MHS), CVS Caremark (CVS) and Rite Aid (RAD).

At the time of publication, Michael Brush did not own or control shares of any company mentioned in this column.

Michael Brush is the editor of Brush Up on Stocks, an investment newsletter. Click here to find Brush's most recent articles and blog posts.