The grueling sport of ultramarathon has fostered a mingling of two seemingly opposite camps: endurance jocks and potheads.

“If you can find the right level, [marijuana] takes the stress out of running,” says Avery Collins, a 22-year-old professional ultramarathoner. “And it’s a postrace, post-run remedy.”

The painkilling and nausea-reducing...