From Bulbapedia, the community-driven Pokémon encyclopedia.
The ghost ship (Japanese: ゆうれいせん ghost ship) is a 300-year-old ship that appeared in A Shipful of Shivers.
The ship used to be a delivery ship, going from island to island and delivering things to other islands. One night, the ship was caught in a terrible storm and sunk.
The ghost ship before sinking
It used to lay on the bottom of the ocean near Moro Island; however, a few days before Ash and his friends arrived on Moro Island, a team of researchers discovered the ship and removed the Orange League trophy that the captain who won 300 years ago. In doing so they also knocked the captain's Gastly and Haunter's Poké Balls open, who saw them take the trophy. Angry that the trophy had been stolen, Haunter lifted the ship to the surface.
The researchers had donated the trophy to the Moro Island Museum of Art, but Team Rocket stole it to give to Giovanni. When Ash and his friends realized that Team Rocket were the thieves, they pursued them to the ocean. Team Rocket fled into the fog in an attempt to lose their pursuers, only to find the ghost ship. At first they thought they were extremely lucky finding a free ship, but soon realized that it was a ghost ship. Gastly and Haunter scared Team Rocket and took the trophy back.
Ash and his friends found the ghost ship and boarded it, but a mast collapsed and Misty's Togepi fell down a hole. Ash and his friends went looking for Togepi, and found it in the room with Gastly and Haunter. Team Rocket then tried to steal the trophy from them, but Gastly and Haunter won and used Meowth to tell Ash and his friends about the history of the ghost ship. After hearing the story, Ash and his friends helped Gastly and Haunter blast off.
Upon leaving the ship, Gastly and Haunter telekinetically lifted the ship in the air and took it where nobody would be able to find it and disturb them.