From Sonic Retro
Pumpkin ghosts are enemies that appear in Sonic Heroes, confined to the spooky levels of Hang Castle and Mystic Mansion. Cackling phantasms with a core of blue light, the ghosts spontaneously appear out of thin air in front of the Teams. Although they don't have any weapons, the ghosts can be a considerable nuisance simply by virtue of their speed and quantity, popping up in the middle of walkways or floating into characters to make them drop all their rings. Any attack (or simply touching them, though naturally the rings are lost) will make the ghosts dissolve back into nothingness.
In Team Dark's Hang Castle there's at least one large version of this ghost (roughly double the height of the normal ones), with the same exact behaviour. In Super Hard mode there's a significant number of them as well. A minority has a default area where they can appear, instead of the standard unchanged default position. They naturally appear where the team leader is. In Hang Castle, there's an extra large version, which head occupies most of the ground of the tower that has ledges spiraling up, after the last checkpoint.
Other ghosts in the Sonic games: