If you've already spoken to Mesprit and it's flown away you need to track it on the Marking Map app on your Poketch. Go to where the flashing black symbol is and try to catch Mesprit when it appears. It's best if you have a really fast Pokemon with Mean Look and Hypnosis or something else that can send Mesprit to sleep. Then keep trying to catch it. Or just use your Master Ball if you don't need it for anything else.