One of the obvious way is to use captcha. A captcha is a group of generated text that a user must then read and enter to verify themselves as human and not some kind of spam bot.
It was always the case that developers try to develop their own captcha system. Either that’s a way to prove their skills, enjoy satisfaction of a nice work, or simply stupidity and wasting time in doing so is another question. Heck, I’ve even seen source code for bypassing phpBB and SMF captcha floating around the net.
I’ve seen quite a few web apps applying the captcha system provided by Recaptcha. Twitter for example, just did. The API is well written and is provided for free in different programming language – PHP, .NET, JSP, Phyton, Ruby, you name it. There’s also a wordpress plugin made available.
By all means, why write custom captcha system when there’s a whole set of system proven working for other people, fully documented with API and provided for free? All you need to do is signup for an API key and you are ready to use it.
BTW, Rapidshare decided to get rid of their captcha on July 2008. Maybe they should just consider using Recaptcha and not using cats and dogs in their captcha.