A ghost is a Second Life object or avatar that is visible to a resident on their screen, but doesn't actually exist on the servers. Ghosting happens when the client doesn't get a command from the simulator to remove the object or avatar.
Attachments can also ghost--or not even rez at all ("anti-ghosting"). According to Vektor Linden, a "good way to force attachments to rez is to put a simple script in them...scripted items have priority for rezzing."
Ghosts can also occur when the sim has crashed (or is frozen) and the user hasn't been logged out of SL.
A ghost will then have "Retrieving..." in its tooltip and, when selected in edit mode, will never display its name, owner, or permissions information. To get rid of a ghosted object, select and drag it offscreen with the position handles. (If a resident doesn't have permission to move the ghost, they usually have to relog to get rid of it, but sometimes teleporting can too.)
A ghosted object/attachment can be edited (if a user has permission) but its changes won't be saved and it can't be detached or taken into inventory.
As of around late 2005 or early 2006, ghosting rarely happens anymore. This is due to improvements to the way SL handles packet information that is being sent back and forth between client and server.