From the Super Mario Wiki
Lantern Ghosts are lantern-carrying specters that closely resemble Shy Guys. Their smile also makes them resemble the trees from the Forest of Illusion in Super Mario World. Despite hating the light and loving the dark, Lantern Ghosts can never be found without a lit lantern.
Lantern Ghosts have close ties with Shy Guys, as seen in Super Mario World 2: Yoshi's Island, Yoshi's Island: Super Mario Advance 3, Paper Mario, and Yoshi's Island DS. In Super Mario Advance 3: Yoshi's Island, they retained the mechanical-sounding squeals from the original, as opposed to the "hei-ho!" voice clip used by Shy Guys. Yoshi's Island DS gave them similar sounding noises. In Yoshi's Island, they are in the cave levels, and almost always in the darkest parts so only their lanterns' light is seen. They are essentially the Shy Guys of caves in Yoshi's Island games, where their mechanics are no different than those of Shy Guys.
Several Lantern Ghosts appear in the basement of Horror Condo in Mario Party Advance. They are a part of a Toad Force V fan club known as the TFV Fan Club. Lantern Ghosts were also referenced in Super Princess Peach, whose King Boo battle (as well as the background of Shriek Mansion's map) featured lightposts clearly modeled after Lantern Ghosts.
There is a possibility that the light in the lantern is a Li'l Sparky, as it was in Paper Mario where the Big Lantern Ghost carried a Li'l Sparky named Watt in his lantern. Lantern Ghosts look similar to Peepas, sharing the same look and floating instead of walking.
 Notable Lantern Ghosts