Well I've never been able to shut down pain as you say, but I think the best remedy is to race a lot (I'm assuming we're talking from a 5k-10k perspective here...marathons are different in how often you can race, but I guess the same idea would apply). Racing feels different than training (at least for me) no matter what you do in your training. If you race a lot you get used to that pain and general feeling of "I think I'm gonna die." For example in high school when I was racing every single week I was really able to learn how to force my body to run through pain and reach closer to its potential--even to where I could run through setbacks like tripping, sideaches, muscle tighness, and getting spiked without much of a problem and win races anyway. Now when I don't have nearly as many chances to race it seems to hurt a lot more because my body isn't used to operating at that level on a regular basis. I'm going to try to change that this summer and cram it full of fun runs and other races every spare weekend I get...just to get a feel for racing again even if I don't set any land speed records. Problem is that gets expensive.
That's just what I've discovered that works for me...I'm sure Sasha and the other running geniuses will get on here and give you much better advice on how that actually works and how to overcome mental barriers. For me it's just doing it a lot.