Running a distance race – like a 246km ultramarathon – takes extraordinary physical fitness. But however hard they have trained, an athlete’s success hinges on their mental endurance.

This story is an adaptation of What are the limits of human endurance?, an episode of CrowdScience presented by Marnie Chesterton and produced by Cathy Edwards. To listen to more episodes of CrowdScience from the BBC World Service, please click here.

In the early hours of a night in late September, somewhere between Athens and Sparta in Greece, a trickle of runners trudge wearily by. It’s dark, it’s raining heavily and these ultra-distance athletes are in the midst of a staggering 246km road race.

These runners are attempting the Spartathlon. Starting at dawn in the shadow of the Acropolis in Athens and finishing in Sparta, the annual event recreates the journey of the ancient Greek messenger Pheidippides, who made the journey in a day and a half to summon Spartan troops. (This ancient ultra-runner is probably better known for his legendary 26-mile (42km) run from the Bay of Marathon to Athens – the origin of the term ‘marathon’.)

The annual race was first held in 1983, when the winning time was 20 hours and 25 minutes. No runner has been able to beat that record since. But there’s no lack of people trying.

The popularity of ultramarathons has shot up in recent years – and so too has interest in the science and mechanics of how the body works in these extreme situations. 

Clearly, anyone who takes part in these kinds of races is going to be running for a very long time. What does it take to be capable of such an act of endurance – both physically and mentally? And what tricks do these athletes use to keep themselves motivated, and on their feet, during a race? 

You might also like:
What’s the fastest we can run?
The ultra-athletes aged 60+
How to exercise smarter

At the Spartathlon, which a freak storm has made especially harsh this year, Dean Karnazes is one such runner pushing his limits. This is his second Spartathlon, but this time he’s had a tough start and is nursing a bruised hip after being hit by a car.

“It’s real at this point, you know, your whole body starts to hurt,” he says.

At this stage of the race Karnazes says the psychological element is important. “It’s really demoralising, going this slowly,” he says. “I’m still moving forward, it’s not pretty, it’s not fast, but it is movement. Kick me in the butt and tell me to keep going.”

And with that Karnazes runs off into the darkness – still hurting.

Speed limit

Mark Burnley, an endurance physiologist at the University of Kent, investigates the biology that underpins how fast somebody can run at a variety of distances, from sprints to ultramarathons.

In distance running, three parameters will determine your performance, he tells Crowdscience. First you need a high VO2 max, the maximum amount of oxygen your body can use during intense exercise. Second is a high lactate threshold, which is the fastest pace you can run without generating more lactate than your body can get rid of. Third, you need an excellent running economy – the human equivalent of the fuel economy of your car, making efficient use of resources to cover the distance.

“If you put those three together you’ll run a fast marathon,” Burnley says. 

The world record marathon is currently just over two hours. Could it get faster still? While a sub-two-hour marathon is probably just a matter of time, Burnley says the body does have some limiting factors.

“The body [has] essentially two systems of energy delivery. We have aerobic metabolism which [uses] molecular oxygen from the atmosphere,” he says. “We then have anaerobic metabolism, which are energy-transfer processes not involving oxygen.” The reason you couldn’t sprint a marathon, he says, is that your body can’t supply energy rapidly enough using the aerobic system.

Ultra-distance runners, meanwhile, obviously run a lot slower than the fastest marathon runners. People tend to complete the first 42km of the race in times closer to three or four hours. But once they’ve done that first 42km, they have almost another five marathon lengths to go.

Endurance limits in terms of ultra-endurance is very much a case of trying to limit the amount of damage you do to your body in that particular event – Mark Burnley

“Endurance limits in terms of ultra-endurance is very much a case of trying to limit the amount of damage you do to your body in that particular event,” says Burnley. “In 5,000 and 10,000m running we often talk about getting up to a certain pace and being able to hold that pace. In an ultra-endurance race, you’re just trying to complete the task.”

What that means in practical terms is a shuffling pace. The aim as an ultra-distance runner “is trying to run with minimal leg lift, essentially trying to minimise the energy cost of your run”, says Burnley.

Mental strength

For many athletes, though, one of the biggest potential limiting factors is the mind.

Back in Greece, Karnazes was last seen shuffling up a mountain in darkness as he was being pummelled with rain. As a seasoned ultra-distance runner, he knows the extraordinary psychological strength required to keep putting one foot in front of the other.

“There are moments when you feel very strong and you feel like you can keep running forever,” he says. “A couple of instances later you feel like, ‘I’ve got to stop, this hurts so badly I can’t make it to the street corner.’ And then you push through that wall and you emerge on the other side and you feel strong again.”

There is no doubt that long-distance running goes hand in hand with mental fortitude; there are Japanese Buddhist monks who run 1,000 marathons in 1,000 days on the road to enlightenment. And there’s the ‘self-transcendence’ race, where competitors run 3,100 monotonous miles around a single city block.

There’s some evidence to suggest that those who compete in ultra-endurance events have a higher pain tolerance – Carla Meijen

“There’s some evidence to suggest that those who compete in ultra-endurance events have a higher pain tolerance,” says Carla Meijen, a sports psychologist specialising in endurance at St Mary’s University in London. “We don’t quite know whether that pain tolerance is the result of pushing yourself and going through all these events or whether it’s something that you have from the start.”

Research suggests that around half of ultramarathon competitors experience significant changes in their mental state. “You might feel a bit disoriented, a bit confused,” says Meijen. “I guess the bigger picture is self-regulation, how are you able to deal with that?”

It’s something Karnazes knows all about. “I think the first half you run with your legs and the next half you run with your mind,” he says of the Spartathlon. “There comes a point in the race where the pain, it owns you and you just have to reckon with the fact that you are in a lot of pain and it’s not going to go away and to deal with it.”

In those moments in a race where your body is exhausted, what are the psychological techniques you can use to push your limits?

According to Meijen, it’s about being ready for those moments. Before the race, she says, you want to reflect on previous experiences, learning from them so that you can prepare how you’ll respond before you get there.

In the race itself, when your brain wants you to stop because you are in pain, use distraction, she says. “It may be that you need to take on more nutrition”, she says, or “think about what you’ll reward yourself with at the end of the event”.

She also suggests using active regulation strategies during a race, such as motivational self-talk or even relaxation strategies.

Whatever you decide works best for you, Meijen says, you need to practise in advance. That way, when you start to feel the exhaustion hit, “you get yourself back into talking yourself out of exhaustion”.

Sleep stock

Tiredness and sleep deprivation is, of course, a big consideration for those running a race that continues throughout the night – or even several nights. One recent study found that the majority of runners try to ‘bank’ sleep ahead of a long race by sleeping longer at night or napping during the day.

Whether or not these elite athletes sleep during a race depends, perhaps unsurprisingly, on the length of the race. For races under 36 hours, such as the Spartathlon, most runners tend to push through and not sleep for the whole distance. For races that would stretch out over more than one night, runners take one or more catnaps lasting between 10 and 30 minutes. Most choose to sleep at night at aid stations, where participants are also given food and water.

In the longest races, a slower pace and quick catnaps had a significant protective effect on the muscles

And these strategic naps had an interesting result. A scientific study of ultra-runners taking part in the Tor des Géants, a 205-mile (330km) race in Italy’s mountains, showed that fatigue and muscle damage was less than it would be for people who had run only half this distance. Researchers found that in the longest races, a slower pace and quick catnaps had a significant protective effect on the muscles. 

For the 239 out of 381 runners approaching Sparta, the finish line is in sight. But there’s no sign of Karnazes. A quick phone call later and he says he didn’t make it.

“It got to me, 24 hours of rain,” he says. “To be honest I’m relieved… there’s never any assurance that you’re going to finish. I have such respect for anyone who was part of this race.”

At the finish line, it’s clear that while there is incredible emotional jubilation, the physical price is high. Some athletes have collapsed. Among them is Cat Simpson, a British competitor, lying on a stretcher covered in a blanket with two drips attached to her.

Evidently running a race like this is about pushing yourself to the very limits and saving any breakdown until after the finish line.

Dora Papadopoulou, an orthopaedic surgeon and sports medicine consultant at the Defence Medical Rehabilitation Centre Headley Court in the UK, has been looking after exhausted runners here for the last 10 years. She lists the most common ailments competitors have: blisters, muscular problems, cramps.

Despite the punishment that this extreme sport inflicts on your body, research has shown that recovery can be remarkable. A recent study of Spartathlon runners showed that just after the race, their blood samples – which looked similar to those of people close to death according to Dr Papadopoulou – returned to normal within days.

For Simpson and other finishers, the race is over for another year.

“It feels like a bit of a dream,” she says, “from about 70 miles I thought I wouldn’t make it in the dark and thunderstorms.”

So, will she be back training for the next one?

“I’m never doing this again, ever,” she says.

Join 900,000+ Future fans by liking us on Facebook, or follow us on Twitter or Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Culture, Capital, and Travel, delivered to your inbox every Friday.