late 14c., in alchemy, "one of the two main ingredients of the philosopher's stone," from Medieval Latin magnesia, from Greek (he) Magnesia (lithos) "the lodestone," literally "(the) Magnesian (stone)," a mineral said to have been brought from Magnesia, the region in Thessaly, which is said to be named for the native people name Magnetes, which is of unknown origin.
The ancient word, in this sense, has evolved into magnet. But in ancient times the same word, magnes, was used of lodestone as well as of a mineral commonly used in bleaching glass (modern pyrolusite, or manganese dioxide).
In the Middle Ages there was some attempt to distinguish lodestone as magnes (masc.) and pyrolusite as magnesia (fem.). Meanwhile, in 18c., a white powder (magnesium carbonate) used as a cosmetic and toothpaste was sold in Rome as magnesia alba ("white magnesia").
It was from this last, in 1808, that Davy isolated magnesium. He wanted to call it magnium, to stay as far as possible from the confused word magnesia, but the name was adopted in the form magnesium. Meanwhile from 16c. the other name of pyrolusite had been corrupted to manganese, and when, in 1774, a new element was isolated from it, it came to be called manganese.
Magnesia in its main modern sense of "magnesium oxide" (1755) is perhaps an independent formation from Modern Latin magnes carneus "flesh-magnet" (c. 1550), so called because it adheres strongly to the lips.
mid-13c., "animating or vital principle in man and animals," from Anglo-French spirit, Old French espirit "spirit, soul" (12c., Modern French esprit) and directly from Latin spiritus "a breathing (respiration, and of the wind), breath; breath of a god," hence "inspiration; breath of life," hence "life;" also "disposition, character; high spirit, vigor, courage; pride, arrogance," related to spirare "to breathe," perhaps from PIE *(s)peis- "to blow" (source also of Old Church Slavonic pisto "to play on the flute"). But de Vaan says "Possibly an onomatopoeic formation imitating the sound of breathing. There are no direct cognates."
Meaning "supernatural immaterial creature; angel, demon; an apparition, invisible corporeal being of an airy nature" is attested from mid-14c.; from late 14c. as "a ghost" (see ghost (n.)). From c. 1500 as "a nature, character"; sense of "essential principle of something" (in a non-theological context, as in Spirit of St. Louis) is attested from 1680s, common after 1800; Spirit of '76 in reference to the qualities that sparked and sustained the American Revolution is attested by 1797 in William Cobbett's "Porcupine's Gazette and Daily Advertiser."
From late 14c. in alchemy as "volatile substance; distillate;" from c. 1500 as "substance capable of uniting the fixed and the volatile elements of the philosopher's stone." Hence spirits "volatile substance;" sense narrowed to "strong alcoholic liquor" by 1670s. This also is the sense in spirit level (1768). Also from mid-14c. as "character, disposition; way of thinking and feeling, state of mind; source of a human desire;" in Middle English freedom of spirit meant "freedom of choice." From late 14c. as "divine substance, divine mind, God;" also "Christ" or His divine nature; "the Holy Ghost; divine power;" also, "extension of divine power to man; inspiration, a charismatic state; charismatic power, especially of prophecy." Also "essential nature, essential quality." From 1580s in metaphoric sense "animation, vitality."
According to Barnhart and OED, originally in English mainly from passages in Vulgate, where the Latin word translates Greek pneuma and Hebrew ruah. Distinction between "soul" and "spirit" (as "seat of emotions") became current in Christian terminology (such as Greek psykhe vs. pneuma, Latin anima vs. spiritus) but "is without significance for earlier periods" [Buck]. Latin spiritus, usually in classical Latin "breath," replaces animus in the sense "spirit" in the imperial period and appears in Christian writings as the usual equivalent of Greek pneuma. Spirit-rapping is from 1852.