It should be a day of celebration for Medco HealthSolutions (NYSE:MHS). Late Monday afternoon, the Department of Justice said the pharmacy-benefits manager had reached a settlement in a long-standing federal inquiry. What's more, investors don't have to worry that the $155 million settlement will dampen earnings, because Medco took a $163 million charge in the first quarter to account for the agreement, which was in the works at that time.

However, the market hasn't been exactly jubilant since the settlement: Shares are down slightly. A likely reason is that two new developments are making shareholders uneasy. While investors have cause to be concerned, Medco remains a solid long-term bet.

The first item is a tentative legal settlement under which average wholesale price will be reduced and then done away with. This price list is an anachronism that was once accurate and is now essentially an arbitrary calculation that for years has helped set consumer prices for prescription drugs.

For Medco and rivals Caremark Rx (NYSE:CMX) and Express Scripts (NASDAQ:ESRX), the settlement will no doubt bring repercussions. However, once the average wholesale price is extinct, the effect -- a narrowing in the spread between manufacturer and consumer prices -- will be most dramatic for branded medicines. By contrast, the sweet spot of Medco's business is dispensing generic, not branded, medicines.

But a second development has raised doubts about Medco's generic side. Wal-Mart (NYSE:WMT) has begun to roll out a plan that offers shoppers a 30-day supply of 300 generics for the cut-rate co-pay of $4, below the price Medco and other pharmacy benefits managers charge for a number of generics.

Admittedly, Wal-Mart never should be taken lightly. However, even the world's retailing juggernaut might find that going head-to-head against Medco is not so wise. Thanks to Medco's automated dispensing facilities, its costs are low, so it's likely it can outcompete Wal-Mart on price. Also, many prescription drug users, particularly older consumers and those who suffer from chronic diseases, are likely to prefer home delivery through Medco's industry-leading mail-order pharmacy to filling prescriptions at Wal-Mart's gigantic superstores.

Medco's latest challenges may indeed buffet the company in the near term. However, its competitive advantages and the ongoing drive to contain prescription drug costs seem likely to keep Medco growing over the long term.

For related content, check out these articles:

Wal-Mart is a Motley Fool Inside Value selection. What is Wall Street overlooking now?Inside Valuegives subscribers the big names with the best prospects for good returns. A free trial gives you all the picks and how they're doing.

Fool contributor Brian Gorman does not own shares in any of the companies mentioned.