Pharmaceutical companies are racing to test new and potentially lucrative treatments for hepatitis C, a blood-borne disease that causes liver damage and is expected to become more common as the U.S. population ages.

Merck will spend $24.50 in cash for each Idenix share. The company's stock closed at $7.23 on Friday and had already climbed 21 percent so far this year. Shares of Idenix Pharmaceuticals Inc. soared about 235 percent before markets opened Monday.

The boards of both companies have approved the deal, which they expect to close in the third quarter.

Merck said Cambridge, Massachusetts company has built a promising portfolio of hepatitis C treatments, including three that have reached clinical testing, or testing in humans. Its most advanced candidate, samatasvir, is in mid-stage testing.

Merck also has a portfolio of hepatitis C treatments that includes Victrelis and several drugs in development.

Doctors have long sought more effective, palatable treatments for hepatitis C. Until late last year, the standard treatments required patients to ingest 12 pills a day, alongside antiviral drug injections that can cause flu-like symptoms. That approach cured only about 75 percent of patients.

Physicians quickly embraced Gilead Sciences Inc.'s once-a-day pill Sovaldi, which was approved by U.S. regulators in December and cures between 80 percent and 90 percent of its patients. Sovaldi racked up more than $2 billion in sales for Gilead in its first full quarter on the market. But the drugmaker has taken criticism for the new pill's high price. One 12-week course of treatment costs $84,000.

Idenix shares climbed $17 to $24.23 in premarket trading. Meanwhile, shares of Merck, which is based in Whitehouse Station, New Jersey, slipped 39 cents to $57.46.