The best method of solving this riddle is to assess the source of pain.  With a new injury (under 72 hours), generally it is best to treat using ice.  Chronic types of pain are generally best treated using moist heat.
In general, you can’t go wrong when using ice.  Ice will calm down most inflammatory conditions within a few short applications.  Cold causes vasodilation within the small blood vessels and decreased the local metabolism.  It slows nerve conduction velocity which is the speed at which nerve impulses are transmitted and therefore reduces the number of pain signals that reach the brain.  It provides vasoconstriction, analgesia, and sedation – and most importantly, relief of pain.  It is indicated for acute musculoskeletal injuries, burns, insect bites, and/or bleeding. Ice should NOT be used for gout, rheumatoid arthritis, Raynaud’s disease, or conditions with vascular impairment.
In contrast, application of moist heat causes vasodilatation the small blood vessels and increases local metabolism.  Vasodilation results in increased white blood cells and increased nutrition to the area and increases removal of metabolic waste products.  Moist heat should NOT be used on acute muskuloskeletal injury, skin conditions, pregnancy, malignancy, diabetes, swollen areas, hemorrhagic disorders.