Think outside the body.
Let your mind take over from your body and try to focus on the outside and everything going on around you. Look around at other runners – chances are there's someone else who looks a lot worse than you feel!
Change your stride.
Making a slight adjustment to your stride can make a huge difference in your level of discomfort. Try to lengthen or shorten your stride a little, or kick up your heels a little bit. You don't need to do it for a long stretch – just enough to switch up the muscles you're using and possibly relieve some pain you're feeling in certain areas.
Do whatever it takes to keep your mind occupied: Sing songs, play mental games, count people, talk to other runners. If you're in a race, focus on what the spectators are cheering and reading their marathon signs.
Talk to yourself.
Whether you think to yourself or actually speak out loud, give yourself a pep talk. Keep repeating your running mantras. Remind yourself what you've sacrificed to get to this point. Remember how you've run through fatigue and soreness before and how you can do it again.
Take a walking break.
Walking during a long run or race gives your running muscles and joints a chance to rest and recover, and can really break up the monotony. Your mind can focus on doing something different, which can be a huge mental boost. Some marathoners like to walk through the water stops, and then start running again once they finish taking their fluids.
Stay mentally tough.
Don't give into periods of self-doubt and discomfort. Remember all the training that you have done and have faith in it. Think about how hard you have worked and how rewarding it will be to complete your marathon.