A laterally oriented GaAs p-i-n nanowire solar cell with Ag gratings is proposed and studied via coupled three-dimensional optoelectronic simulations. The results show that the gratings significantly enhance the absorption of nanowire for both TM and TE polarized light due to the combined effect of grating diffraction, excitation of plasmon polaritons, and suppression of carrier recombination. At an optimal grating period, the absorption at 650–800 nm, which is an absorption trough for pure nanowire, is substantially enhanced, raising the conversion efficiency from 8.7% to 14.7%. Moreover, the gratings enhance the weak absorption at long wavelengths and extend the absorption cutoff wavelength for ultrathin nanowires, yielding a remarkable efficiency of 13.3% for the NW with a small diameter of 90 nm, 2.6 times that without gratings. This work may pave the way toward the development of ultrathin high-efficiency nanoscale solar cells.