Firstly, it depends on the kind of pain - if it's in a joint or hurts when you apply pressure, you've probably strained/sprained it and should ice it and rest it completly for a few days. If you've been doing anything anaerobic or high intensity, it could be lactic acid, in which case the muscle will be tender to the touch, and will respond better to heat. This type of pain shouldnt last more than a day or so and will be reduced in the future by drinking isotonic drinks or increasing salt intake. If the muscle hurts and is stiff (ie you have reduced flexibility) you can use it, you just need to warm up properly and do a massive stretch after the warm up and after the excercise. With this kind of muscle ache you should take at least one day off in a week to let the muscles rebuild. Hope that helps.