Basically the Ghost Marowak is the Sprit of a Marowak that died in the Pokémon Tower. It died protecting it's young from Team Rocket who invaded the Pokémon Tower to try and steal the skulls of Cubone and sell them for large amounts of cash. Even though the Marowak's young escaped, Marowak it's self was killed in the Tower and jus it's Sprit remains there. It will forbid the player access to the topmost floor.
It will appear as a Ghost, avoid all thrown Poké Balls, and scare opponents so much that they would be unwilling to attack. However, the player can unmask it with the Silph Scope to show it's true form and subsequently battled it. Once defeated, it's soul will be calmed and it be depart into the afterlife.