Was just in a similar situation (put a big chunk of money toward mortgage or invest it). Read thoughts & analysis from several sources. Ric Edelman is all about carrying the biggest, longest mortgage you can because you can invest and make a higher percentage in the market (probably) than you pay in mortgage interest, plus that mortgage interest is tax deductible. If you put a huge chunk towards your mortgage, then need/want that money for big unexpected expense, it can't come out of the mortgage nearly as easily as it can out of a mutual fund.
That said, the mortgage is a consistent, steady monthly payment, and obviously returns on the stock market can vary. We ended up sort of splitting the difference, put enough toward mortgage to get rid of our PMI and get a little better rate, then invested the rest. At the end of the day I say it's all about what makes you comfortable and lets you sleep easy at night.