An automatic method of designing grating instruments equipped with aberration-corrected gratings has been developed. The optimization was made of the light path function in nonexpanded form, instead of the expanded path function in conventional methods, over a given range of wavelength for given ruled area and entrance-slit height. The method was applied to the design of a Seya-Namioka monochromator and was compared with conventional ones. The present method seems to be effective especially for grazing incidence spectrometers, spectrometers with a small F-number, and as such.