Literal ghost
From Bulbapedia, the community-driven Pokémon encyclopedia.
Ghosts (Japanese: ゴースト Ghost) are souls that live in Lavender Town's Pokémon Tower.
In the games
In the games, before getting a Silph Scope, several unidentified ghosts (namely Haunter and Gastly) appear. Later, another ghost is revealed to be Marowak killed by Team Rocket. Therefore, it now haunts the Pokémon Tower.
Without the Silph Scope, the ghosts are unbattlable. Whenever the player orders an attack against the ghost, the message comes up "(POKéMON) is too scared to move!", and instead of attacking, the message comes up: "GHOST: Get out.... Get out....". If one tries to throw a Poké Ball at a ghost, it dodges it, and the message comes up "It dodged the thrown BALL! This POKéMON can't be caught!". This also happens with the Marowak's ghost, before or after unmasking it.
The player eventually needs to defeat Giovanni in Celadon City's Rocket Hideout and get the Silph Scope, an item made by Silph Co. that makes ghosts visible. After the Marowak has been defeated, several Team Rocket Grunts that are "talking" with Mr. Fuji about that they killed it must be battled. In Generation II, Mr. Fuji created Lavender Volunteer Pokémon House for the same reason as Pokémon Tower, after the tower become the Kanto Radio Tower. The ghost itself is uncatchable.
The ghost is also related to two glitches. One of them is the fact that the sprite is used as one of MissingNo.'s forms in Generation I, while the other is that it can be battled as a normal Pokémon by walking through walls in Generation II.
In the anime
In the anime, a ghost of the same sort appeared briefly in The Tower of Terror. It even had Pokédex data, though that data simply said that it was missing data. Later, a Haunter takes Ash's and Pikachu's souls out of their bodies after they have been killed by a chandelier. Here is it shown that ghosts can fly around and remain in the form they took while living, however, with the exception that living beings cannot see them.

