Spectrographs are used in a variety of applications in the field of remote sensing for radiometric measurements due to the benefits of measurement speed, sensitivity, and portability. However, spectrographs are single grating instruments that are susceptible to systematic errors arising from stray radiation within the instrument. In the application of measurements of ocean color, stray light of the spectrographs has led to significant measurement errors. In this work, a simple method to correct stray-light errors in a spectrograph is described. By measuring a set of monochromatic laser sources that cover the instrument's spectral range, the instrument's stray-light property is characterized and a stray-light correction matrix is derived. The matrix is then used to correct the stray-light error in measured raw signals by a simple matrix multiplication, which is fast enough to be implemented in the spectrograph's firmware or software to perform real-time corrections: an important feature for remote sensing applications. The results of corrections on real instruments demonstrated that the stray-light errors were reduced by one to two orders of magnitude, to a level of approximately 10-5 for a broadband source measurement, which is a level less than one count of a 15-bit resolution instrument. As a stray-light correction example, the errors in measurement of solar spectral irradiance using a highquality spectrograph optimized for UV measurements are analyzed; the stray-light correction leads to reduction of errors from a 10 % level to a 1 % level in the UV region. This method is expected to contribute to achieving a 0.1 % level of uncertainty required for future remote-sensing applications.