Vacuum ultraviolet spectroscopy of molecules using third-harmonic generation in rare gases