OS X Mail provides additional junk mail filtering using a statistical (Bayesian) algorithm. This filtering identifies certain messages as spam based on a statistical analysis of the words in the message. In order to use this filtering, you must first ``train'' the program by letting it know which of your mail you consider to be junk mail. You can do this by clicking on the Junk icon (top right) whenever you receive a message which you think is junk.
After a week or two of this training, OS X Mail should be able to identify messages as spam automatically, just as you would do manually. Go to Junk Mail from the Mail menu and select Automatic. After doing this, all current and new junk mail will be moved to a Junk mailbox. You should check this mailbox on occasion to make sure it isn't accidentally marking messages as junk that you would wish to receive. If it is doesn't seem to be doing a good job of filtering mail, you may need additional training. Pull down the Mail menu, select Junk Mail and then Training. Set this back to Automatic after additional training.
For more information, see http://www.csun.edu/itr/email/spam/OSXmailfilter.html.