The classic martini of yore was stirred, "so as not to bruise the gin." (as martini is 5 parts gin and 1 part water and olives) W. Somerset Maugham declared that "Martinis should always be stirred, not shaken, so that the molecules lie sensuously one on top of the other," while James Bond from the Ian Fleming novels ordered his "shaken, not stirred", a drink properly called a Bradford.
The concept of "bruising the gin" as a result of shaking a martini is an oft-debated topic. The term comes from an older argument over whether or not to bruise the mint in preparing a Mint Julep. A shaken martini is different from stirred for a few reasons. The shaking action breaks up the ice and adds more water, slightly weakening the drink but also altering the taste. Some would say the shaken martini has a "more rounded" taste.
Others, usually citing hard-to-track-down scientific studies, say that shaking causes more of a certain class of molecules (aldehydes) to bond with oxygen, resulting in a "sharper" taste. Shaking also adds tiny air bubbles, which can lead to a cloudy drink instead of clear. In addition the drink is a perfect aperitif - it cleanses the mouth before eating - and the tiny air bubbles restrict the gin (or vodka) from reaching all tastebuds.
This is why purists would claim that a martini should always be stirred. Some martini devotees believe the vermouth is more evenly distributed by shaking, which can alter the flavor and texture of the beverage as well. In some places, a shaken martini is referred to as a "Martini James Bond".