UnitedHealth Group Inc.’s OptumRx agreed to buy Catamaran Corp., a provider of pharmacy benefit management services, for about $12.8 billion in the company’s largest purchase ever, to add clients and improve its technology.

UnitedHealth will pay $61.50 a share in cash, financing the acquisition with existing cash and new debt, the companies said in a statement. That’s 27 percent more than Schaumburg, Illinois-based Catamaran’s closing share price of $48.32 on Friday.

“The combination diversifies OptumRx’s customer and business mix, while accelerating its technology leadership and flexible service offerings,” the companies said. Catamaran adds an “industry-leading technology platform” to OptumRx’s capabilities in data and analytics, they said.

OptumRx and Catamaran offer specialty pharmacy services, an industry with about $100 billion in annual revenue that may quadruple by 2020, the companies said. Catamaran manages more than 400 million prescriptions a year for 35 million members, while OptumRx manages prescription drug benefits for commercial and governmental health plans and works through a network of about 66,000 community pharmacies and mail-order pharmacies.

“The combination of the two companies will create a unique offering in the industry unparalleled by current participants,” Larry Renfro, CEO of OptumRx, said in the statement.

Mark Thierer, Catamaran’s chairman and chief executive officer, will become CEO of OptumRx, and Timothy Wicks, the current CEO, will become president, according to the statement. The purchase is expected to be completed in the fourth quarter of 2015, and will add about 30 U.S. cents to UnitedHealth’s earnings per share in 2016, the companies said.

Recent mid-market pharmaceutical deals include Guardian Parmacy of America's purchase of two long-term care pharmacies and PE-backed Modern Healthcare's deal for two specialty pharmacies