Old English gast "soul, spirit, life, breath; good or bad spirit, angel, demon," from Proto-Germanic *ghoizdoz (cf. Old Saxon gest, Old Frisian jest, Middle Dutch gheest, Dutch geest, German Geist "spirit, ghost"), from PIE root *gheis- "to be excited, amazed, frightened" (cf. Sanskrit hedah "wrath;" Avestan zaesha- "horrible, frightful;" Gothic usgaisjan, Old English gæstan "to frighten"). This was the usual West Germanic word for "supernatural being," and the primary sense seems to have been connected to the idea of "to wound, tear, pull to pieces." The surviving Old English senses, however, are in Christian writing, where it is used to render Latin spiritus, a sense preserved in Holy Ghost. Modern sense of "disembodied spirit of a dead person" is attested from late 14c. and returns the word toward its ancient sense.
Most Indo-European words for "soul, spirit" also double with reference to supernatural spirits. Many have a base sense of "appearance" (e.g. Greek phantasma; French spectre; Polish widmo, from Old Church Slavonic videti "to see;" Old English scin, Old High German giskin, originally "appearance, apparition," related to Old English scinan, Old High German skinan "to shine"). Other concepts are in French revenant, literally "returning" (from the other world), Old Norse aptr-ganga, literally "back-comer." Breton bugelnoz is literally "night-child." Latin manes probably is a euphemism.
The gh- spelling appeared early 15c. in Caxton, influenced by Flemish and Middle Dutch gheest, but was rare in English before mid-16c. Sense of "slight suggestion" (in ghost image, ghost of a chance, etc.) is first recorded 1610s; that in ghost writing is from 1884, but that term is not found until 1919. Ghost town is from 1908. To give up the ghost "die" was in Old English. Ghost in the machine was Gilbert Ryle's term (1949) for "the mind viewed as separate from the body."