Lab testing firm and Motley Fool Inside Value pick Quest Diagnostics (NYSE:DGX) took a hit earlier this year from the loss of a major contract, but a market leadership position and appealing business model look to be keeping it from going down for the count.

Back in January, Quest lost a lucrative contract with managed-care behemoth UnitedHealth Group (NYSE:UNH). And to add insult to injury, UnitedHealth went with archrival LabCorp (NYSE:LH) -- which actually wasn't that surprising, as the two are the largest publicly traded lab testers. Quest estimates that hospital-affiliated labs carried out 60% of the $45 billion spent in the industry last year, but that leaves plenty for Quest, LabCorp, and smaller rivals such as Bio-Reference Labs (NASDAQ:BRLI) and Medtox (NASDAQ:MTOX).

The UnitedHealth loss cost Quest about 4.4% of second-quarter revenue and about 7% of testing volume, but a recent acquisition of cancer diagnostic testing firm AmeriPath allowed for total top-line growth of 3.7%. Reported earnings from continuing operations fell 9%.

Cash generation continued to be strong at Quest, but it still needed to increase debt to buy AmeriPath. Still, it has a track record of supplementing organic growth through acquisitions, and was able to pay a dividend and buy back stock.

The market clearly liked Quest's second quarter, sending the shares up as much as 6% after it released results yesterday. The UnitedHealth contract loss was obviously a near-term setback, but I still like Quest's long-term appeal. It is an industry leader, has high profit margins, and generates plenty of capital with which to maintain its business, grow (organically and by buying out the competition), and cut costs during times of adversity. The same goes for LabCorp -- at the right price.           

For related Foolishness:

LabCorp and UnitedHealth are Stock Advisor selections. Interested in health-care stocks that Tom and David Gardner have recommended? Then sign up for a free 30-day trial of Stock Advisor, which is beating the market by more than 37 percentage points. Quest and UnitedHealth are Inside Value recommendations.

Fool contributor Ryan Fuhrmann is long shares of Quest, but has no financial interest in any other company mentioned. Feel free to email him with feedback or to discuss any companies mentioned further. The Fool has an ironclad disclosure policy.