High-Resolution Terahertz Gas Spectroscopy