Some trends are favorable for the retail pharmacy industry. As the U.S. domestic population ages and health care insurance coverage expands, the pharmacy benefit management (PBM) business is expected to surge. The increasing number of lives covered following the health care reforms should also benefit this business by increasing sales.

Not everything is good news, however. Wal-Mart (WMT 0.28%) recently made its entrance into the retail generic drug market, which forces drugstore companies to lower prices and lose margins. To see the full effect of this, let's analyze three companies in the sector.

BioScrip: Margins down but outlook good
The first company to review is the third-largest home infusion services provider, BioScrip (OPCH 1.68%). The company enjoys competitive advantages in this segment, owning 60 infusion pharmacies.

Despite the company's impressive 22.3% jump in revenues, the second-quarter adjusted loss remained flat year over year at $0.02. BioScrip's margins are contracting due to escalating costs and expenses. Gross margin contracted 260 basis points to 31.8% in the quarter, showing that there are still things to work on.

There is some hope, though. Strategy-wise, the company is focusing on its strong infusion segment. BioScrip experienced a robust 41.5% increase in infusion revenue this last quarter, the main driver for the company's strong results. Acquisitions will be key looking forward, since they will strengthen the company's market position. BioScrip's $223 million acquisition of CarePoint goes in this direction, as it will increase the company's top line. This past February, the company also took over HomeChoice, which has been integrated successfully. In July, it acquired site infusion pharmacy services provider InfuScience. The infusion market is expected to grow in the range of $15 billion to $20 billion from current range of $9 billion to $11 billion, so there is substantial space for growth.

CVS Caremark: Good margins being threatened
Another company to consider is CVS Caremark (CVS 0.74%), which owns approximately 7,300 stores nationwide and enjoys 21% of the whole U.S. prescriptions market.

The company showed mixed results for its second quarter. Although adjusted earnings per share grew an outstanding 19.5% and revenue in the specialty pharmacy rose roughly 19%, front-end sales declined. Unlike BioScrip, CVS Caremark's margins are expanding, thanks to the steady growth of generic medicine. The gross margin improved 60 basis points, while the operating margin improved 60 basis points--not bad at all for this industry.

PBM is showing good performance for CVS Caremark as well, which has an expected market share of 26% for 2013. However, the recent Medco-Express Script $29 billion merger has created a dominant player that will cover more than 150 million prescription drug consumers and half of the large employer market. This will bring intense competition and erode margins for the company going forward.

Rite Aid: Will good margins and expansion continue?
The third and last company to analyze is Rite Aid (RAD -10.00%), which operates 4,623 retail drugstores in 31 states across the U.S.

The introduction of high-margin generic drugs and increased prescriptions at pharmacy counters has enabled Rite Aid to post quarterly profits for the past four consecutive quarters. As with CVS Caremark, the company is putting extra attention into the generic medications that are the primary driver of its gross profits. Generic drugs are less expensive but generate higher gross margins for Rite Aid, improving profitability. As explained before, however, this outlook could change.

Another approach taken by the company is to broaden its customer base by expanding its Wellness+ customer loyalty program and by remodeling its wellness stores. Remodeled stores now feature a new vision center, diabetic diagnostic center, men's grooming, and other things that tempt customers to remain inside the stores and purchase more. By the end of fiscal 2014, management expects to have converted 400 stores into wellness stores.

Keep in mind that Rite Aid presented a high 171% debt-to-capitalization ratio at the end of fiscal 2013, limiting its ability to obtain additional financing and restricting its cash flow availability. As a result, the company has to face increased interest expenses, which damages its bottom line.

Bottom line
Although BioScrip's infusion business is growing, the company is still showing weaknesses that could affect its profits in the near term. If you are initiating a position in the company, keep an eye on its margins.

CVS Caremark is in an interesting spot strategy-wise considering that its best margin generation segments are being threatened. Its PBM business will face tougher competition from a new dominant player, and on the generics front it will have Wal-Mart pushing prices down. If the company manages to maintain its profitability, it will definitely be a stock to buy.

Despite the profitability and strong quarter performance, Rite Aid's debt ratios put it in an unfavorable position compared to its peers. Limited and costly financing could put a cap on future expansion plans and remodeling, which were proving successful and will necessary in the coming quarters. Moreover, if profitability decreases due to lower margins coming from generic drug sales, Rite Aid will have to rely on its Wellness+ business. Performance of these segments should be closely monitored.