The article considers 30 solar flare events during which the spectra of solar cosmic-ray (SCR) protons with energies above ~80 MeV were recorded in the course of the PAMELA experiment (July 2006–September 2014) and those with energies above ~0.4 GeV recorded during the AMS-02 experiments (June 2011–September 2014). The Konus-Wind data are analyzed for the same time period (2006–2014), during which 176 events with photon energies below 1 MeV and 16 events with energies above 1 MeV were observed. Gamma rays with energies of 1–15 MeV and SCR protons with energies above ~0.1 GeV were simultaneously recorded during only one flare. In the other 15 events, a correlation was noted between the Konus-Wind data and GOES observations of fluxes of SCR protons with energies of ~10–100 MeV. The spectra and angular distributions of solar gamma rays entering into the interplanetary space are calculated with the Monte Carlo method. The ratio of the intensities of gamma-ray 511-keV and 2.223-MeV lines is shown to strongly depend on the profile of the SCR proton spectrum. Observations of the 2.223-MeV line cannot help in the search for solar flares with the generation of solar neutrons and deuterium nuclei.