Infineon Technologies AG agreed to buy International Rectifier Corp. for about $3 billion, a deal uniting mature semiconductor makers that points to quickening consolidation in the sector.

The German company's $40-a-share offer represents a 51% premium to International Rectifier's closing share price on Tuesday, and the stock surged by nearly that percentage on Wednesday to $39.10.

Infineon's...