We present a method of directly measuring the spontaneous Raman scattering in optical waveguides in an alignment-free setup. Using a pulsed laser, liquid-crystal-on-silicon spatial light modulator and single-photon detector, we create a broadband photon-counting Raman spectrometer. The temperature and polarization dependence are characterized in an As2S3 amorphous glass fiber for a Stokes detuning range of 1 to 9 THz from the pump frequency. We fit our experimental data with a theoretical model and extract the Raman-gain spectrum and compare to free-space measurements of bulk As 2S3. The sensitivity of the method in principle allows direct characterization of chip-scale nanophotonic devices.