The most common technique for active protection is known as Captcha. There a number of ‘flavours’ such as ReCaptcha, Image Captcha ( typically words), Picture identification Captcha, Mathematical captcha, Question Captcha etc.
All these methods rely on the fact that automated scripts are unable to read the Captcha and thus pass through the process. These methods can be effective in fighting ‘comment’ and ‘registration’ spam.
Where they fail is where a human being is manually adding the comments or registrations. Where labour is cheap if may be worth the ‘promoter’ paying for people to generate the spam.