You got so many answers you won't read them all, but here's mine, anyhow. There is no such thing as the Yahoo lottery. Yahoo does not conduct lotteries or give away money. That said, what you did was open spam email.
According to the anti-spam experts, we are seeing far more spam mails now than ever before. And the spammers are becoming more clever about getting past the spam filters. That's why more spam is making it to the Inbox instead of going straight to the Bulk/Spam folder, and why some of your good mails are ending up in the Bulk/Spam folder. There are a few basic things we can all do to keep spam to a minimum...
1. Spam mails that go straight to the Bulk/Spam folder should be left there, unopened. You can empty that folder any time you want, but never NEVER open spam mails. DON'T try to unsubscribe from anything and DON'T click any links in those mails.
2. Spam mails that land in your Inbox should be marked as Spam so that they are moved to the Bulk/Spam folder and their addresses placed on the Blocked list. (Blocking an address prevents mails from being received from that address in the future.)
3. Any email that you are the least bit suspicious about should be deleted immediately. Don't let curiosity get the better of you. Simply opening a spam email out of curiosity could alert the spammers that you have an active email address (they probably didn't know it before), to which they will undoubtedly send TONS of spam mail in the future. Open emails ONLY from those you know and trust.
Lots of spammers have automated scripts that send emails out using a "dictionary attack". This means their script just sends out tons of emails to various combinations of numbers and letters at different domains. Kind of like if you just started calling phone numbers starting with 100-100-0000 then 100-100-0001, etc. They don't know what is a valid email address and what is not. When you reply to one (try to unsubscribe, or replying back telling them how you hate them), you are now confirming your email address is a real, live email address. They have special lists of those, because they know they're guaranteed real. They then sell those lists to other spammers at a premium. Then you get more spam!