The two, ok three tips for making perfect lemon meringue pie come from Shirley Corriher who wrote CookWise. (PS She's the actual scientist behind Alton Brown, btw.)
First, you want to put your meringue onto a hot, just baked filling. That way, the meringue actually starts to cook before you put it into the oven, resulting in a meringue topping that is baked all the way through.
Second, sprinkle a thin layer of fine, dry bread crumbs over the top of your hot lemon filling before adding the meringue. They will swell and absorb excess moisture from the filling and meringue at the same time as keep the meringue in place.
Third, when making your meringue, cook 1 tablespoon of cornstarch in 1/3 cup water until smooth and thick. Add 1 or 2 tablespoons of this cornstarch mixture to your meringue when just about done whipping. It will keep the meringue from shrinking and weeping-even when raining cats and dogs outside.
I've used these three techniques when making LMP for photography, and it works perfectly every time. LMP is considered the acid test for food stylists as it's notoriously difficult to get a perfect slice for shooting.
Of course, you must make sure that your filling recipe is up to snuff. Many have significant problems in setting when cooled-often due to an imbalance of acid to eggs to starch to sugar.
Read Shirley's book CookWise. Her explanation and recipe for LMP is worth the cover price alone, not to mention how she explains the science of tempering chocolate and the Maillard reaction.