1650s, from Dutch gas, probably from Greek khaos "empty space" (see chaos). The sound of Dutch "g" is roughly equivalent to that of Greek "kh." First used by Flemish chemist J.B. van Helmont (1577-1644), probably influenced by Paracelsus, who used khaos in an occult sense of "proper elements of spirits" or "ultra-rarified water," which was van Helmont's definition of gas.
Hunc spiritum, incognitum hactenus, novo nomine gas voco ("This vapor, hitherto unknown, I call by a new name, 'gas.'") [Helmont, Ortus Medicinae]
Modern scientific sense began 1779, with later secondary specialization to "combustible mix of vapors" (1794, originally coal gas); "anesthetic" (1894, originally nitrous oxide); and "poison gas" (1900). Meaning "intestinal vapors" is from 1882. "The success of this artificial word is unique" [Weekley]. Slang sense of "empty talk" is from 1847; slang meaning "something exciting or excellent" first attested 1953, from earlier hepster slang gasser in the same sense (1944). Gas also meant "fun, a joke" in Anglo-Irish and was used so by Joyce (1914). Gas-works is by 1817. Gas-oven is from 1851 as a kitchen appliance; gas-stove from 1848.
According to Wiktionary, "The verb sense derives from the 1938 stage play Gas Light, in which a husband attempts to convince his wife and others that she is insane by manipulating small elements of their environment."