It began to be used in astronomy in 1814 by Joseph Franhofer, when he invented the diffraction grating, with fine slits drawn on a glass. Applying it to the end of a telescope, he made the light of a star pass through it, obtaining break it down in its luminous spectrum; in the same way that a prism does, but with greater precision. Some years later it was proven that they were formed by the same chemical elements existing on Earth and the Sun, when the stellar spectra were compared with those emitted by known chemical elements on our planet, when heated.
A spectrograph breaks down white light into wavelengths of its components forming the spectrum crossed by numerous dark and light lines. Record these lines as a kind of barcode of the object's physical properties. Spectroscopy is the basis of modern astrophysics. Almost all the information we have about the chemical composition, temperature and pressure of any astronomical body is encoded in its spectral lines.

amateur spectrography
As technology advances, amateurs are now able to access procedures that were previously only reserved for professionals. The field of spectrography is no exception, and therefore today it is perfectly possible for an amateur to have a domestic spectrograph or to build one at home, and take measurements of stars with relative ease. For this purpose, it is necessary to have a diffraction grating, essential to decompose the starlight into its spectrum, and a CCD sensor, which we can obtain from an amateur CCD, such as the DeepSky Pro from meade, or the sensor included with the Philips TouCam Pro webcam. The diffraction gratings are mounted on rings of 1.25 inches (standard diameter of a telescope eyepiece), so they only need to be placed before the CCD sensor to work. Subsequently, you must work with appropriate software (such as Visual Spec), and you will be in a position to obtain the first spectra. The most popular diffraction gratings are Star Analyzer, which cost around USD 140.