Good news on December 21 for CVS Caremark (CVS) in bad news from Walgreen (WAG), the largest US drugstore chain. (CVS Caremark is a member of my Jubak’s Picks 12-18 month portfolio.)

Walgreen reported earnings for the first quarter of fiscal 2012 of 63 cents a share. That was below the 67 cents a share expected by analysts. The bad news from Walgreen dropped the company’s share price by about 0.3% on December 21.

The biggest factors in the miss were a delay in the onset of flu season—that cut flu shots administered by the chain to 5 million through November 30, from 5.6 million in the same period n 2010—and Walgreen’s continued dispute with pharmacy benefit manager Express Scripts (ESRX).

The two companies have not been able to resolve a dispute over pricing in a new contract. The old three-year agreement expired on December 31, and it looks like Express Scripts will take much of its business to other drugstore chains.

And that’s the good news for CVS Caremark. CVS shares are up 2.7% from the close on December 21 to 1:30 p.m. New York time on January 3.

Exactly how much of Express Scripts’ $5.3 billion in annual revenue actually walks away from Walgreen after the companies stop doing business is still a huge unanswered question.

Walgreen says that it will do enough business with Express Scripts by December 31 to reach 97% to 98% of its fiscal 2011 prescription total in the fiscal year that ends in August 2012. But Walgreen’s CFO has also estimated that the company will ultimately lose 26 million of the 88 million prescriptions it now fills for Express Scripts.

Wall Street analysts say that Walgreen will lose most of its Express Scripts prescriptions, and will also see a drop in sales of other merchandise, as fewer shoppers go to Walgreen to fill prescriptions. According to CVS, 43% of its stores are within a mile of Walgreen stores. About 33% of Rite Aid (RAD) stores are within a mile of a Walgreen store.

The ripples of the Walgreen-Express Scripts dispute threaten to get even larger since Express Scripts has bid to acquire Medco Health Solutions (MHS), another big pharmacy benefits manager. An acquisition wouldn’t end Walgreen’s contracts with Medco immediately, but the company would undoubtedly lose them over time.

My prior target price for CVS Caremark shares was $45 by October 2012. As of today, January 3, I’m raising my target to $46 by October 2012.

Full disclosure: I don’t own shares of any of the companies mentioned in this post in my personal portfolio. The mutual fund I manage, Jubak Global Equity Fund, may or may not now own positions in any stock mentioned in this post. The fund did not own shares of CVS Caremark as of the end of September. For a full list of the stocks in the fund as of the end of September, see the fund’s portfolio here.