Muscle Soreness - How to treat and prevent
Exercise type:
Simply put, some forms of exercise can be extremely hard on your body; especially if you have particular physical problems.    For example, if you have bad knees, running on the tread mill may cause you severe problems. Depending on how bad your knees are, you may switch to swimming which would be the best exercise since it works the full body and burns many more calories.  But if you don't have a place to swim, the elliptical can be a good alternative.  Consult your doctor or physical therapist before you start.

Protein:
Your muscles require protein to repair themselves.  If you are not getting enough protein, your muscles will be sore longer since they are not getting the necessary protein they need to repair themselves.  The same can be true if you are lacking other nutrients.  Eating a balanced diet is essential.

Warm or cold:
Depending on your body, putting a cold compress on a sore muscle or soaking it in warm water may help.  Sitting in a hot tub can bring welcomed relief.

Stretching:
Stretching is good BEFORE and AFTER your workouts.  It increases more blood flow to the muscles which prevents injuries.  It also helps the blood remove bi-products of exercise and decreases the effect of lactic acid.  But stretching is also good for sore muscles by the same process of increasing blood flow and nutrients to help repair the muscle.  You can also use extremely light stretching and exercise to help relieve soreness in the muscles. This will help with blood flow and allow for quicker healing.

Rest:
Often times simply allowing your body to rest and relax will help soreness.

Water:
Particularly if you are doing aerobic exercise and sweating a lot, you may be dehydrated.  Drinking plenty of water will keep your muscles hydrated and may take care of much of the soreness.  When you body becomes even slightly dehydrated, muscle cramps can occur. 

Over the counter pain relievers:
Consult your doctor first, but the use of over the counter anti-inflammatory medicine like aspirin or Ibuprofen can be a help.   Once your muscles get built up enough that you are able to tolerate the pain, it is best to stop using any pain medication.  Some have been found to partially inhibit muscle growth and cause health complications with long-term use.  It is better to take Beta Alanine since is works well without the problems.

See your doctor:
If you still have abnormal soreness, contact your doctor.  You could well have a vitamin D deficiency or other medical problems.  Vitamin D deficiencies are common with overweight individuals.
Further Reading:
Muscle Pain: When to see a doctor
by the Mayo Clinic
D4L.org