This question was posted on Scientific American.  Bottom line:

Exercising regularly, even taking a walk for 20 minutes several times a week, may help you cope with stress.

The scientists looked at the brain cells of these so-called stress-resistant mice and found that the rodents exhibited more activity in their medial prefrontal cortex and their amygdala, both of which are involved in processing emotions. The mice that did not exercise before moving in with the aggressive mice showed less activity in these parts of the brain.

Check the link for more description of the study.