The survey of more than 100,000 male and female runners found that those who ran marathons were less likely to be on medication for those health problems.
Also, those who included longer distance runs in their routine were less likely to be on medication.
The findings appear in the journal Medicine and Science in Sports and Exercise.