We investigate the effect of doped Er3+ ion concentration on an electromagnetically induced grating in an Er3+-doped yttrium aluminum garnet (YAG) crystal. Due to the change of electric dipole moment and spontaneous emission decay induced by Er3+ ion concentration, the Fraunhofer diffraction of the solid-state grating is sensitively dependent upon Er3+ ion concentration. The three-level Er3+ ion system with a closed loop leads to probe gain appearing in some concentrations of the Er3+ ion, which significantly improves the first-order diffraction efficiency of the solid-state grating. Furthermore, it is demonstrated that the relative phase, signal detuning, and grating thickness have different effects on the first-order diffraction efficiency of the solid-state grating under different concentrations of the Er3+ ion. Therefore, our scheme may provide a basis for selecting a suitable concentration to realize high-efficiency optical switching and routing in future integrated systems. (C) 2021 Optical Society of America