The nation’s largest health insurer, UnitedHealth, will muscle up for its fight against rising prescription drug costs by spending more than $12 billion to buy pharmacy benefits manager Catamaran Corp.

Pharmacy benefits managers, or PBMs, help negotiate the prices that customers pay for prescription drugs. They are seen as a key component in the push to contain soaring costs from specialty drugs, complex medicines that can represent treatment breakthroughs but often at a much higher price than other drugs.

Rising costs from these drugs are expected to affect more patients as use of the treatments grows and coverage for them shrinks.

UnitedHealth and Catamaran said Monday that their deal will combine businesses that have “distinctive, rapidly growing specialty pharmacy services” for a segment of the market that is expected to quadruple from an estimated $100 billion in revenues last year to possibly $400 billion by 2020.

Specialty drugs treat certain forms of cancer, multiple sclerosis and hepatitis C, among other conditions. They have always been pricey but confined to relatively small patient populations. That’s changing, due in part to some newer hepatitis C treatments that could be used by millions of patients.

Nearly 32 cents of every dollar spent on prescriptions now goes toward a specialty drug, according to the nation’s largest pharmacy benefits manager, Express Scripts Holding Co. That’s up from 12 cents of every dollar spent in 2009.

PBMs run prescription drug plans for employers, insurers and other customers. They have been countering rising specialty drug costs by requiring patients to try other treatments first or by doing more care management to make sure customers stay on their medicines. They also can use the leverage that comes from their size to negotiate coverage restrictions that lower costs.

The deal is expected to close during the fourth quarter.