Drug giant Merck said it will buy Cubist Pharmaceuticals for about $9.5 billion, or $102 a share in cash, bringing Merck a slate of medicines administered in the hospital setting, many for bacterial infections.

News of the deal sent Cubist's share price surging by more than 34 percent, to $101.15, in premarket trading. Merck's stock price also rose more than 5 percent.