MIRI (the Mid InfraRed Instrument) is one of the focal plane instruments of the James Webb Space Telescope. The instrument comprises a camera and a spectrometer module. The instrument plays the following key roles in the JWST science program. - Discovery of the “first light”. - Assembly of galaxies: history of star formation, growth of black holes, production of heavy elements. - Formation of stars and planetary systems. - Evolution of planetary systems and conditions for life. The MIRI spectrometer covers the spectral range from 5 – 28.3 μm with a spectral resolution better than 2000. The spectral module is an imaging spectrometer with a field of view ≥ 3 arcsec. The spectrometer consists of 4 spectral channels that share 2 detectors of 1024 × 1024 pixels each. In a single measurement one third of the wavelength range of the channels is imaged onto the detectors. By changing gratings the whole spectral range is covered in 3 measurements. In this paper the optical design of the MIRI spectrometer is described.