Is there a rule of thumb about sports injuries and when to apply ice, as opposed to heat?

Generally... Generally, ice causes the blood flow to decrease in an area so it will theoretically help more for inflammatory conditions like an acutely sprained ankle or knee. Other, chronically damaged joints (such as knee arthritis), seem to feel better with heat. This is not entirely true, however, as sprained back often feels better with heat than ice, possibly because it relaxes the muscles.
Swelling. Inacute injury, generally ice better in stiffness heat is better. If you develop swelling after trauma, never apply heat.
Ice. Any time you incur a sports injury, ice will help reduce pain and swelling. Heat is reserved for chronic conditions, to help " loosen up' tight muscles and joints.