CVS Caremark Corp. said Tuesday that its third-quarter earnings climbed 16 percent. The drugstore operator and pharmacy benefits manager posted revenue increases in both businesses, benefiting from new customers won from rivals, and raised its full-year earnings outlook.

The Woonsocket, R.I., company said it earned $1.01 billion, or 79 cents per share, in the three months that ended Sept. 30. That compares with earnings of $868 million, or 65 cents per share, in last year’s quarter. Adjusted earnings were 85 cents per share, 2 cents better than analysts expected. That excluded $121 million for the gradual writedown of acquisition-related assets.

CVS said revenue from pharmacy services climbed 22 percent to $18.1 billion, mainly because of new client starts, growth of its Medicare Part D prescription program and higher medication prices. The segment processed about 255 million prescription claims in the quarter, up 11 percent.

Revenue from drugstores rose 5.5 percent to $15.5 billion, as revenue at stores open at least a year rose 4.3 percent from a year earlier. They filled about 210 million prescriptions in the quarter, up 12 percent, when counting 90-day prescriptions as three monthly prescriptions.

The retail and pharmacy services segments have some overlapping revenue, so their total exceeds company revenue by a few billion dollars.

CVS Caremark got a significant bump from millions of Walgreen Co. customers who migrated to CVS stores during a nearly nine-month split between Walgreen and Express Scripts Holding Co., which runs drug plans for employers, insurers and other customers as a pharmacy benefits manager, or PBM. Walgreen fills prescriptions for Express Scripts, but the two let their contract expire at the end of 2011. They resumed doing business Sept. 15.

The new customers added about 3.5 cents per share to third-quarter results and should add another 2.5 cents in the fourth quarter.

Besides the many new clients and higher drug prices, CEO Larry Merlo cited improved operating profits due to productivity measures, more flu-related prescriptions, an uptick in patient visits to doctors and more patients taking their maintenance medication as scheduled — because new generic versions of several widely used drugs has made them more affordable. Several blockbusters taken daily by millions have gotten U.S. generic rivals since last Nov. 30, including cholesterol fighter Lipitor, blood thinner Plavix, Singulair for asthma and allergies and blood pressure treatment Diovan.

Merlo said CVS now anticipates retaining at least 60 percent of the prescriptions gained during the impasse, up from a prior forecast of about 50 percent. More than 80 percent of those new customers have enrolled in the CVS Caremark loyalty program, called ExtraCare.

“The outstanding service that customers received, the ExtraCare card, the strong (store brand) offering, combined with the convenient locations” could drive the 60 percent retention forecast even higher, Citigroup analyst Deborah Weinswig wrote to investors.

Optimism about that let the company to raise its 2012 profit forecast. It now expects adjusted earnings of $3.38 to $3.41, up from its previous forecast of $3.32 to $3.38 per share, and net earnings per share of $3.15 to $3.18.

Merlo noted that more then 1,100 CVS stores were closed at the peak of Superstorm Sandy, but all but 20 have reopened. Those lost sales could reduce fourth-quarter earnings per share by a penny.

CVS Caremark runs the second-largest chain of drugstores in the U.S., after Walgreen’s, with 7,423 pharmacies, including more than 40 new stores opened during the quarter. The company also operates about 600 MinuteClinic locations and six mail-order pharmacies, plus a dozen mail-order pharmacies and 31 retail pharmacies devoted to specialty drugs. Those are very expensive, usually injected drugs for complex chronic health conditions — a category that is driving overall spending on medications.

Revenue from the specialty pharmacy segment jumped 34 percent.

Merlo said CVS saw significant jumps in the number of PBM clients requiring their members to get maintenance drugs via mail order, which saves those payers money, and more people enrolled in CVS “pharmacy adviser” plans that help patients with diabetes and heart disease stick to their medication schedules and avoid expensive complications. Those programs are to be expanded to more diseases next year.