Solar energetic particles acceleration by a shock wave accompanying a coronal mass ejection (CME) is studied. The description of the accelerated particle spectrum evolution is based on the numerical calculation of the diffusive transport equation with a set of realistic parameters. The relation between the CME and the shock speeds, which depend on the initial CME radius, is determined. Depending on the initial CME radius, its speed, and the magnetic energy of the scattering Alfven waves, the accelerated particle spectrum is established during 10-60 minutes from the beginning of CME motion. The maximum energies of particles reach 0.1-10 GeV. The CME radii of 3-5 $R_odot$ and the shock radii of 5-10 $R_odot$ agree with observations. The calculated particle spectra agree with the observed ones in events registered by ground-based detectors if the turbulence spectrum in the solar corona significantly differs from the Kolmogorov one.