Heat and cold are the two most common types of noninvasive and nonaddictive pain-relief therapies for muscle and joint pain. Which one you use depends on whether the pain is new or recurring.
In general, a new injury will cause inflammation and possibly swelling. Ice will decrease the blood flow to the injury, thereby decreasing inflammation and swelling. Pain that recurs can be treated with heat, which will bring blood to the area and promote healing.