We describe a spectrometer consisting of a vector network analyzer, a gas absorption cell, and a quasi-optical bench that acquires terahertz spectra of gaseous substances and mixtures. We tested volatile organic compounds that are medical biomarkers or chemicals which can be found on the US Environment Protection Agency list of harmful substances. Absorption spectra at gas pressures between 10 Pa and 5000 Pa were recorded. A subsequent multivariate data analysis demonstrated excellent qualitative and quantitative identification of pure substances and complex mixtures. The applied multivariate algorithms are principal components analysis, partial least square regression and soft independent modelling of class analogy.