(Reuters) - Drugstore operator Rite Aid Corp said it would buy pharmacy benefit manager EnvisionRx for about $2 billion, entering the business of administering health plan benefits.

The third-largest U.S. drug-store operator's shares rose 12 percent to $8.48 in early trading on Wednesday.

The deal will help Rite Aid compete better with CVS Health Corp, which bought Caremark Rx for $21 billion in 2006.

The acquisition of EnvisionRx will also give Rite Aid access to more prescriptions and help source drugs at lower prices.

Two analysts called the deal a "strategic positive" for Rite Aid, saying it would give the company broader access to specialty pharmaceuticals business.

Specialty pharmacy provides personal medication management services to patients with complex and unique medication needs, and typically cost more. It covers a range of diseases from cancer and multiple sclerosis to rare genetic conditions.

Pharmacy benefit managers administer drug benefits for employers and health plans and run large mail order pharmacies.

EnvisionRx manages pharmacy benefits for over 13 million individuals. The privately held company is a unit of Envision Pharmaceutical Holdings LLC, which is owned by private equity firm TPG.

Rite Aid said it would pay about $1.8 billion in cash and $200 million in stock for EnvisionRx.

(Reporting by Sruthi Ramakrishnan and Vidya L Nathan in Bengaluru; Editing by Saumyadeb Chakrabarty and Sriraj Kalluvila)