We describe a simple and robust method using an internal reflection element acting as an infrared waveguide to measure the spectra of near-field thermal emission. We experimentally demonstrate the spectrally-narrow peaks of near-field thermal emission by isotropic media due to the excitation of surface phonon-polaritons in quartz and amorphous silica and due to the frustrated total-internal-reflection modes in amorphous silica and polytetrafluoroethylene. Additionally, we demonstrate the broadband near-field thermal emission of hyperbolic modes in hexagonal boron nitride which is an anisotropic uniaxial medium. We also present a theoretical approach based on the fluctuational electrodynamics and dyadic Green's functions for one-dimensional layered media for accurate modeling of the measured spectra.