The classic option for preventing spam form submission is with CAPTCHA (http://en.wikipedia.org/wiki/CAPTCHA) and there have been later improvements on this to benefit accessibility issues such as http://recaptcha.net/.
Content management and blogging systems like Drupal, Wordpress etc. all have a selection of plugins to prevent spam. So if you’re using a system such as these, check out their plugin directory for the most popular (e.g.