Ice or heat? Ice! (It's almost always ice.) If you take the back of your hand and touch the area of pain, you'll likely find that the area is warmer than the other areas of your spine. If heat is present, there's no need to add more.
If you're taking over-the-counter medications to help inflammation, adding heat will make them less productive while ice will only improve upon the effects.
Ice for no more than 20 minutes per hour on the mid and lower back and no more than 15 minutes on the neck. Icing longer than this may have the opposite effect from what is intended. The blood vessels will only constrict for so long, and leaving the ice on will eventually cause them to open up -- just as if you've applied heat.
Do not apply ice directly to your skin. Place a layer of paper towels or a hand towel to your skin before placing ice on your area of pain.
A bag of frozen peas makes for a good homemade ice pack, but don't eat the peas afterward. Small ice packs are available in the office for $20, while large ice packs are $30.