Old English gast "breath; good or bad spirit, angel, demon; person, man, human being," in Biblical use "soul, spirit, life," from Proto-West Germanic *gaistaz (source also of Old Saxon gest, Old Frisian jest, Middle Dutch gheest, Dutch geest, German Geist "spirit, ghost"). This is conjectured to be from a PIE root *gheis-, used in forming words involving the notions of excitement, amazement, or fear (source also of Sanskrit hedah "wrath;" Avestan zaesha- "horrible, frightful;" Gothic usgaisjan, Old English gæstan "to frighten").
Ghost is the English representative of the usual West Germanic word for "supernatural being." In Christian writing in Old English it is used to render Latin spiritus (see spirit (n.)), a sense preserved in Holy Ghost. Sense of "disembodied spirit of a dead person," especially imagined as wandering among the living or haunting them, is attested from late 14c. and returns the word toward its likely prehistoric sense.
Most Indo-European words for "soul, spirit" also double with reference to supernatural spirits. Many have a base sense of "appearance" (such as 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, mere shadow or semblance" (in ghost image, ghost of a chance, etc.) is first recorded 1610s; sense of "one who secretly does work for another" is from 1884. Ghost town is from 1908. Ghost story is by 1811. Ghost-word "apparent word or false form in a manuscript due to a blunder" is from 1886 (Skeat). Ghost in the machine was British philosopher Gilbert Ryle's term (1949) for "the mind viewed as separate from the body." The American Indian ghost dance is from 1890. To give up the ghost "die" was in Old English.
"to ghost-write," 1922, back-formation from ghost-writing (1919) "article written by one man upon material supplied in interview or otherwise by a second and which appears in print over the signature of such second party" ["The Ghost Writer and His Story" [Graves Glenwood Clark, in "The Editor," Feb. 25, 1920], from ghost (n.) "one who secretly does work for another (1884). Related: Ghost-written. Ghost-writing also was used from c. 1902 for secret writing using lemon juice, etc. A late 19c. term for "one whose work is credited to another" was gooseberry-picker.