How did I get a virus?!

Hi,

I have been using antivirus for many years.  About 2 days ago I was locked out of my hotmail (which I access off of Livemail), the password was changed, and a series of emails were sent to my contacts for the email account that were advertisements and I'm assuming more viruses.  I don't know how Norton didn't pick up on this. 

I did some reasearch but I want to understand how this happened and how I can prevent this from happening again.  I've owned a computer or laptop for many, many years and pride myself on the fact that I don't get viruses, etc and this has about driven me nuts lol. 

Any help you could offer would be greatly appreciated.

PS

I did just upgrade to Norton internet security after this happened.