Merck & Co. dove deeper into the antibiotic drug market Monday when it agreed to buy Cubist Pharmaceuticals for $9.5 billion, including debt.

The deal would pay shareholders $102 per share in cash, which Merck calculates is a 35 percent premium to Cubist's average closing price in the preceding five days. The agreement includes $8.4 billion for the shares and assumption of about $1.1 billion in company debt.

Merck is based in Whitehouse Station, N.J., and has large facilities in Upper Gwynedd and West Point, Montgomery County. Cubist is based in the Boston suburb of Lexington.

"Cubist is a global leader in antibiotics and has built a strong portfolio of both marketed and late-stage pipeline medicines," Merck chief executive officer Kenneth C. Frazier said in a statement. "Combining this expertise with Merck's strong capabilities and global reach will enable us to create a stronger position in hospital acute care while addressing critical areas of unmet medical need, such as antibiotic resistance."