I got a Spanish SIM card though a company called Orange, and got a plan called La Ballena (the whale) which got me some internet and some phone calls/SMS. I hear Yoigo is a pretty good company as well.
Whatever you do, don’t use Vodafone. In addition to my own bad experience with the company, I have heard an endless amount of horror stories about them I will not waste your time with.
Some phone companies will want to have your foreigner’s card number (NIE, or numero de identidad de extranjer@) which you may have gotten on your temporary visa in your passport, but you also may have to wait to acquire. It’s fairly random who has theirs stamped in their passport or not. Luckily if you don’t have your NIE, some of the company branches won’t care, and will let you use your passport number. It’s a toss up to figure out who will and won’t, and you will soon learn that this sort of attitude is fairly common in Spain, and that the same thing will happen if you attempt to open a bank account (this is a prime example of when the Auxiliar page on Facebook comes in handy for questions on specific phone and bank branches).