In Y! Mail, make sure to mark any spam messages in your Inbox, as Spam.
See picture:
When they are in the Spam box, leave them there.
===========
If SpamGuard is not on, then do the following: (Assuming All-New Yahoo! Mail)
Click Options > Mail Options
Then, on the left, click Spam.
Right beside Control Spamguard, place a check next to Automatically Send Suspected Spam to my Spam Folder.
Click Save Changes button. Then, click the Back to mail button.