On the ex-dividend date, the stock price is adjusted downward by the amount of the dividend by the exchange on which the stock trades. For most dividends this is usually not observed amidst the up and down movements of a normal day's trading. It becomes easily apparent, however, on the ex-dividend dates for larger dividends, such as the $3 payment made by Microsoft in the fall of 2004, which caused shares to fall from $29.97 to $27.34.
The reason for the adjustment is that the amount paid out in dividends no longer belongs to the company and this is reflected by a reduction in the company's market cap. Instead, it belongs to the individual shareholders. For those purchasing shares after the ex-dividend date, they no longer have a claim to the dividend, so the exchange adjusts the price downward to reflect this fact.