If it's a torn muscle heat/ice will make no difference, it will heal either naturally (small tear) or with surgery (major tear IE. David Beckham). If its a pulled muscle then ice it every 10 Min's/per hour to ward off inflammation, keep area elevated to discourage blood flow and rest it. Muscle cramp or tightness then heat it, heat pads or hot bath.
With me, I find if I bend over (example) and feel something pull or twang then it's a pulled muscle, but if I bend over and when straightening up feel something pull or tighten then it's usually muscles cramping up (gardening with wind on your back).
Cures, after 20 yrs of back pain through work, weight training, boxing,golf and running, I found 1st. Massage 2nd. stretching 3rd. lower back/ stomach exercising and 4th. cycling, all helped to make the last 4 yrs totally pain free.
When you do any activity your muscles tighten up, become knotty and get minute tears, Massage relieves all this. Warm up and stretch before any activity, after, cool down and stretch for longer as this will help relieve tension in the muscles and stretch them back out. Exercising both lower back and stomach will create strength in these areas and strong muscles will take more stress if needed. With cycling I found that I do not get the stress and trauma of running, nor the sprains, twists and jolts up the legs and lower back.
I still weight train but very light weights, cycle 120 mls per wk in winter 150+ summer, golf, fly fish, but I am to old to box now (kept getting hit). Some people complain that they get bad backs after exercise and therefore it must be the activity thats the cause, this is not true! what tend to happen is that after their activity, they do not cool down and stretch, but slump in a chair and doze off or watch telly(golfers after all the stress their backs take, into the club house slump in a chair and have a pint, classic example) then an hour later after the muscles have relaxed into the slumped position, they have to go shopping or something similar, so the muscle start to cramp up or even pull because they have got tight in the relaxed position. It's most important especially for cyclist's to watch their posture (small arch in the lower back)