Well, the first things you can do are immediately following the race. Always do some sort of cooldown, ideally with some light running and/or walking and possibly including some stretching if you normally stretch.
Massage, even self-massage, can also help as can ice or a cold bath. An easy run the day after the race will often also help by getting the blood flowing to the muscles. Some people take anti-inflammatories, such as ibuprofen (Advil), but I'm not convinced they do a whole lot for you unless you're taking them at levels that you should only be doing under a doctor's supervision.
Just some ideas off the top of my head, I'm sure others will offer more ideas.
I am going to be repeating people, but it is really important to refuel as soon as you can after the race. Also do some stretching and walk around a bit. After a long race be sure to at least get up the next day and go for a walk. If you can manage a light jog do that.