How do mergers affect stock prices

How do mergers and acquisitions impact the share prices of the companies involved?