It depends on which muscles are sore and when they are sore.
If they only ache a day or two after strenous exercise
, this is called delayed onset muscle soreness- doms- and is completely normal. Generalized achiness responds best to exercise- increased blood flow to the muscles brings them more oxygen
. Stretching, ice, and heat can also help. See your doctor if not improving.