LinkedIn shares soared and Microsoft stock fell after Microsoft agreed to buy LinkedIn, the professional networking services firm, for $26.2 billion.