As a general rule, Ice works best when someone just had an acute injury or flare up of their pain. The reason this holds true is because when someone strains their neck and initially has neck pain, he/she will typically have inflammation. The ice helps take this inflammation down. The inflammation is what contributes to pressure on the nerves. Just because you do not see swelling, doesn't mean there's no inflammation. Much of the inflammation can be be internal- in the joints and around the nerves causing pain and suffering. You may have redness in the injured area, swelling and even feel heat which are clear signs of inflammation. The ice will take this inflammation down decreasing the pain. Also it can have a numbing affect to the area which will decrease the pain sensation. Ice can be used as much as possible. Choose an ice pack that will help cover the area properly. So for example, if you are looking for an ice pack for the neck, consider a 6" x 20 " ice pack designed to cover the neck and upper shoulder area comfortably.
Heat also can help decrease overall pain, and most people's first inclination is to use heat therapy. However, heat should more often be used when you have a chronic neck condition. Heat helps increase circulation and loosen muscles. This can increase mobility and help toxins leave the area and allow helpful nutrients to get in. Similar to ice, heat will relax the area, reducing pain. So, as a general rule use ice when you initially injure or reinjure your neck. Use heat when you have a chronic neck ache or have tightness or stiffness.
Both heat and ice are natural pain relief techniques and have no side effects. There's no set in stone rule which you should or should not use. Which ever one helps the most, I would use. For most of us 20 minutes on with ice or heat followed by 20 minutes off done 2-3 times seems to work best. If recurrences of neck injuries sprains or strains regularly occurs one should make sure to have their spine looked at by a health professional. Use a good cervical support neck pillow when sleeping, and be aware of your neck posture throughout the day.
Additional Reading Resources