From Bulbapedia, the community-driven Pokémon encyclopedia.
The portal to the Ghost World in Litwick Mansion
The Ghost World or spirit world (Japanese: れいかい Spirit World), also refered to as the world of spirits, is a plane of existence depicted in the anime and mentioned in the games. It is known to be home to Ghost-type Pokémon—most notably Dusknoir—as well as actual ghosts of people and Pokémon. It is also known to emit electrical or radio waves.
In the games
All of Dusknoir's Pokédex entries highlight its connection to the Ghost World. Its Diamond Pokédex entry mentions that the antenna on its head captures radio waves from the "world of spirits" that command it to take people there. Its Platinum Pokédex entry mentions that it takes lost spirits into its body and "guides them home", presumably referring to the Ghost World. Its HeartGold and SoulSilver Pokédex entries mention that it travels to "worlds unknown" and that it takes lost spirits with it, which is also presumed to be a reference to the Ghost World.
In addition to these, the Japanese name of the Reaper Cloth (れいかいのぬの Spirit World Cloth) indicates that it comes from the Ghost World.
In the anime
The portal to the spirit world at the Summit Ruins
The spirit world debuted in Ghoul Daze!. The staff of the Pokémon Summer Academy were renovating the Summit Ruins so that the students could collect medals from there as part of a competition they had set up, but accidentally damaged a stone structure, which created a cave that was actually a portal to the spirit world. Doing so allowed a ghost girl to escape, who was followed by a Dusknoir who was trying to protect people from the ghost girl and send the ghost back to the spirit world. The girl first tried to lure Conway off a cliff, then tried to lure Ash and Angie into the portal to the spirit world. When this failed, she was able to cause the spirit world portal to forcefully suck Ash and Angie into it. However, she was stopped by Dusknoir, who then destroyed the cave, sealing the entrance to the spirit world and trapping the ghost girl there. Also in this episode, Dusknoir's Pokédex entry mentions that receives electrical waves from the spirit world with its antenna and is said to take people to the spirit world as well.
The Ghost World, as it is now referred, then appeared in Scare at the Litwick Mansion!. In this episode, several wild Litwick and a Lampent opened a portal to the spirit world in the Litwick Mansion. As described in their Pokédex entries, Litwick and Lampent will pretend to be helping people by illuminating dark areas, but are actually leading them to the Ghost World while sucking their life energy.