Dealt with that a lot in high school and early on in college. I learned a few things that helped me out:
1) when you "do great" in practice, it probably means you are working out TOO hard, and expending mental energy at practice when you need to be saving it up for the race.
2) Nobody will disown you if you run poorly. I put too much pressure and expectations into my races. I tended to do better early in the season at unimportant meets, but the important ones I bombed. You need to not worry so much about your races, and just treat them like a workout. Don't drastically change things leading up to a race, and do something mindless the day before/day of (watch TV, whatever) to keep your mind off it. No need wasting mental energy. You need to arrive at the starting line feeling fresh and happy and confident, not like you've already ran the race 10 times in your head.
3) Confidence is very important. For me, I got my confidence from getting in a ton of good training over the summer. So when I started to run well, it was because I was confident in my fitness and didn't have to WORRY about performing--it was a given that I'd PR, but it was up to me by how much. When you know you are in great shape, it is also easier not to push it too hard in your workouts (as paradoxical as that seems). The real trick is staying mentally together when you are NOT in great shape...and I still struggle with that. The key there, I think, is having realistic expectations, as depressing as that sounds. Don't try to go out and be a hero if you haven't been working out at a level that indicates you can do what you want to do. And don't fool yourself into thinking you are more fit than you really are by running yourself into the ground in your workouts.
4) Finally, relaxation is very big too. When you are nervous, you waste energy. If you can relax, and let things (and people) go, you will do a lot better.