I don't know for sure, it was just a common theme between the people I know that were affected. I imagine FB or some other account that you use the same password on got hacked and they got your password there, then just tried that password on your gmail (which is likely a contact email for you on FB), when it worked they just sent a ton of spam.
I admit I don't have any hard evidence proving this, so it could be wrong, just concidental.
There is actually lots of discussion on this over on google's gmail stuff that I looked through when trying to figure this out myself.
But its in your best interest to at least do the rest of what I said immediately.
Edit: here is an example of what happened to you being discussed on the gmail forums.
http://www.google.com/support/forum/p/gmail/thread?tid=38569835b18232a9&hl=en Was your facebook password the same as your gmail one?
Edit 2: Actually I vaguely remember reading a news article a while back saying there may have been some exploit with mobile gmail? All the IPs came from mobile phones when I looked at where my account was being accessed..
Edit 3: Found what I was talking about.
April 20, IDG News Service – (International) Drug-dealing spammers hit Gmail accounts. Google is investigating a growing number of reports that hackers are breaking into legitimate G-mail accounts and then using them to send spam messages peddling Canadian pharmaceutical websites that promised to send cheap drugs to U.S. customers. The problem started about a week ago but seems to have escalated recently. “The G-mail team takes security very seriously and is investigating the reports we’ve seen in our user forums over the past few days,” Google said April 20 in an e-mailed statement. “We encourage users who suspect their accounts have been compromised to immediately change their passwords and to follow the advice at the following page: Gmail accounts are often compromised after phishing attempts or via malicious programs, which can seek out and log online credentials from a hacked computer. It is note that hackers appear to be sending spam via G-mail’s mobile interface - which gives mobile-phone users a way to check their G-mail accounts. The G-mail users wondered if there may be a bug in the mobile interface that is allowing criminals to send the spam.
Source