One blustery day, SpongeBob and Patrick were watching clouds. Suddenly, something strange and glowing floated overhead. "It's a haunted houseboat" shrieked SpongeBob. But Patrick wasn't convinced, so he marched up the creaky stairs and went inside. SpongeBob nervously followed him. Patrick thinks the boat is lame, but SpongeBob thinks it is real. With a flash of lightning and a roar of thunder, a ghostly pirate captain appears. SpongeBob asks the ghostly pirate captain "Why have you came to Bikini Bottom?" The ghostly pirate captain explains that boat's engine is broken and it needs a new gasket.
The ghostly pirate captain then puts SpongeBob's and Patrick's souls into bottles and gives SpongeBob a doubloon to buy a new head gasket. He says that if they do not return with a new head gasket in 24 hours, SpongeBob and Patrick will become part of his ghastly crew forever. SpongeBob and Patrick ran screaming from the haunted house boat all the way to the Krusty Krab. They burst through the doors and told Mr. Krabs about the ghost, the broken engine, the gold coin, and the treasure chest. After hearing this, Mr. Krabs marches outside and takes a gasket from a car. Mr. Krabs returns with the gasket and says "Let's go see this ghost fella. I'll catch him and take all his gold." Sandy then appears with ghost catcher equipment and wants to catch some ghosts.
The ghost hunters returned to the creepy old houseboat. They tiptoed the creaky floors and searched the shadowy rooms. SpongeBob suddenly finds gold doubloons. Mr. Krabs giggled with joy as he ran to the treasure chest, shoved clawfuls of coins into bags and threw the bags to Squidward and Patrick. The ghost pirate materialized with a flash of lightning and wonders who took his gold. SpongeBob says "We brought you a gasket for your engine. I was hoping you'd give me and Patrick our souls back."
SpongeBob then handed the gasket to a ghostly crew member, who floated away to fix the engine. The ghost captain poured a bottle of orange fluid into SpongeBob's head. He threw another bottle to Patrick, who dropped it. The bottle broke, and Patrick quickly started licking up the spill. The ghost captain states that you can't really take a person's soul and the orange fluid is just old orange juice.
Meanwhile, Mr. Krabs was trying to sneak away with the gold. As he slowly pulled open a door, it let out a long creak. The ghost pirate heard it and swooped after him.
Suddenly, the door swung all the way open. Mr. Krabs, Squidward, and Patrick were sucked into a strange black emptiness with no up or down. "And no one escapes the Void!" the ghost captain said with an evil laugh. Back on the houseboat, Sandy jumped into action. Energy bolts flew from her ghost catcher and pulled Mr. Krabs, Squidward, and Patrick out of the Void. As Mr. Krabs and the ghost captain began to fight over the gold, SpongeBob made a discovery. SpongeBob found the gold, belonged to the Flying Dutchman seeing as his name and phone number was written on the treasure chest.
The ghost captain states that he took the Flying Dutchman's gold a long time ago and he has never found it since. A cannonball abruptly crashed the door and revealed the Flying Dutchman! The Flying Dutchman is there to reclaim his gold doubloons. "This might be a good time to leave," SpongeBob whispered. He dragged Mr. Krabs out the door, and his friends followed along. Once, they are out of the haunted houseboat, SpongeBob claims you should always report stolen property to the authorities and especially haunted treasure.
SpongeBob and Patrick are running from Lord Poltergeist with Patrick carrying a chest and the Haunted House Boat and Charlie are in the background.
If one looks closely at the book cover, Charlie can be seen.
In the episode, it ended with SpongeBob and friends getting chased by the Flying Dutchman and getting stuck in a void. However, in the book, it ends with SpongeBob and his friends leaving the haunted houseboat.