(Sorry it's a long answer, but it's complicated question/solution.)
This has been happening to both Yahoo and Hotmail accounts, but even more so recently. You may have opened an infected mail or an attachment. Your address may have been found on someone else's infected computer. Some new malware can install itself just by opening it, without even clicking a link! (It only takes a few hours to crack an 8-character password!) If the mail goes to your Contacts list or you receive Mailer Daemon bounce-backs, you have had your account hacked temporarily - all they wanted was your address list. The mails will stop when they move on to spam other victims. OR, they found your address in someone else's account and are 'spoofing' or faking it to send spam.
Deleting your account or Contacts List will NOT stop this spam - once the spammers have the address, they will continue to use it for a while. Spam sent to your Contacts will also stop in a while, but it is annoying. Yahoo's advice is to change your password, but there is more to do than just that.
1. Check that the alternate e-mail address is still yours, under Options, Mail Options, Account Information, then change it! (so the hacker will not be notified of the change). Then change both your password AND your secret questions and answers. Make them unique and long, strong ones with mixed characters!
(*** Changing your password also deletes the cookie which apparently inserts that sly trojan address grabber. ***)
If you used this password for other accounts, change them too - make every one different. Make the password much longer than 8 characters, with mixed symbols.
Usually, this is all you need to do, although mail will still be sent in the name of the old account for a while.
For a Yahoo account, you can change your password at https://edit.yahoo.com/config/change_pw. If you can no longer access your account, you can get a new password at https://edit.yahoo.com/forgotroot/.
If you still can’t access your account after going through the “Forgot Your Password” process, you may contact the Customer Care team for assistance. Click Help, then Customer Care, then Live Chat - it make take a while, but a human answers! (If the page loads slowly, refresh it, or click the F5 key.) You will be asked several questions to verify that you are the owner of the account.
2. *** If spam mail was sent to any of your contacts, apologize, and notify all your contacts NOT to open short e-mails, especially those with no subject, and definitely not to click any links. Warn them to change their passwords and scan for malware too, just in case. Set up an alternate 'alias' account to use instead. This allows you to use a different address for sending, but still keep all saved mails and contacts and the first address active too for incoming mail. Your friends can trust this new address. (There is a choice of address in an arrow in the From: box.)
3. Just to be very sure your computer is not infected, run both an anti-virus and spyware/malware scans, updated and separately - even more than one malware scan, or Trend Micro's Housecall for an online a-v scan. (in 'Safe Mode with Networking' is the only truly effective method - click F8 repeatedly when the screen first lights on boot-up, then arrow keys and Enter to navigate.) Re-boot into Safe Mode for each separate scan. These are the best free anti-malware programs.