Tutorial: Cloaking and Stealth Technology
A: “Ghost Pages” come under many different names: stealth, cloaking, food pages, and more.
We actually prefer to term them “Phantom Pages” because that's exactly what they are: not “ghosts” as in “spirits of essentially dead people” but phantoms (or, arguably, “shadows”) of genuine html pages as normally expected.
The technique employed (usually based on Perl/CGI) consists of feeding the search engine spider a different (phantom) page from the one the normal user gets to see. As these do not have to be human-readable, you can optimize them no end to comply with SE requirements.
Note that this is no simple redirection trick (which would be penalized by many major SEs): the Perl program will actually READ the phantom page and feed it to the SE spider without redirection. It is only the human visitor's browser that gets redirected. Hence, the SE spider will never know the difference.
Obviously, it all depends on recognizing the SE spider when it comes. This is where many programs default: the bad ones will simply rely on the spider's UserAgent code, which, however, is dead easy to simulate or forge. (This is an important point in that your competitors might otherwise peek into your phantom page and steal your optimization code — quite a common practice, unfortunately.)
Good phantom or cloaking programs will identify spiders from their unique IP which cannot be forged (or, at least, not that easily — IP spoofing requires a lot of tech expertise and is actually illegal in many jurisdictions now). For this to work, you will need as comprehensive a SE spider database as possible.