Samples are aliquoted at Quest Diagnostics Nichols Institute outside San Juan Capistrano. Quest Diagnostics is a leading provider of prenatal and genetic mutation tests.

Losing exclusive contracts might normally seem like bad news, but shares of Quest Diagnostics and LabCorp surged on Friday after the rival lab services firms announced new non-exclusive agreements with health insurers.

Starting in 2019, LabCorp will no longer be the exclusive lab provider for UnitedHealth, but it will gain access to Aetna. Meanwhile, Quest will lose its exclusivity with Aetna, but will be among UnitedHealth's preferred providers.

Quest gained 4.9 percent on Friday, while LabCorp closed up 3.8 percent after hitting a historic high.

"This expanded agreement is the culmination of our years-long effort to return to a full collaborative relationship with Aetna," said LabCorp CEO David King in a statement announcing the new partnership. He said the company was also pleased with the term of its new agreement with United.

Analysts say the dual announcements mean Quest and LabCorp likely did not have to resort to rock-bottom pricing to hold onto their agreements, and likely won't suffer when it comes to market share.

"Quest and LabCorp are now de-risked from the possibility of getting denied access to a major health plan. While we view Quest as the net winner given it picks up more "net lives" … we believe both labs are well positioned to win back business from regional labs that had benefitted from (their past) exclusion from major health plan," wrote Canaccord Genuity analyst Mark Massaro in a note to clients.