In Hinduism, spirits are called luminous bodies because they would have only two of the normal five elements (ether and light). They would temporarily have received such a type of body because, although spiritually highly developed , they had a certain strong attachment just before their death.
These "luminous bodies" would end up in lonely places and by helping people in need eventually be reborn in a normal body with five elements.
Ghosts are considered in Hinduism as creations of their own imagination , which are visible to others.
They were also frequently supposed to glow in the dark with a sort of phosphorescent light .
Possibly the belief arose from the idea that the soul was like a fire dwelling in the body.