MSL have two Optical Emission Spectroscopy facilities (OES). One supplied by GNR Italy, and one by Oxford Instruments. Both machines are shown in the following photo.
The basic mechanism of OES is the excitation of emissions spectra. In its simplest form it consists of the simple school classroom demonstration of the flame test by adding a chemical compound to a flame as shown in the photograph below
The OES instrument generates the emission using a spark which then emits light which is then passed through a diffraction grating to disperse the spectrum and then individual wavelength intensities are measure by CCD chips (Charge Coupled Device which are a highly sensitive photon detector) The element percentages are then calculated by the PC, displayed and stored. The schematic of the instrument is shown in the image below.