Taking into account results of numerous experiments, the variability of the energy spectra of cosmic rays (protons and helium nuclei) in the energy range of 10 GeV to ~107 GeV is explained on the basis of a hypothesis of the existence of two variable sources close to the Sun. The first (soft) surfatron source (with a size of ~100 AU) is located at the periphery of the heliosphere. The second (hard) surfatron source (with a size of ~1 pc) is situated in the Local Interstellar Cloud (LIC) at a distance of <1 pc. The constant background is described by a power-law spectrum with a slope of ~2.75. The variable heliospheric surfatron source is described by a power-law spectrum with a variable amplitude, slope, and cutoff energy, the maximum cutoff energy being in the range of EСН/Z < 1000 GeV. The variable surfatron source in the LIC is described by a power-law spectrum with a variable amplitude, slope, and cut-off energy, the maximum cut-off energy being EСL/Z ≤ 3 × 106 GeV. The proposed model is used to approximate data from several experiments performed at close times. The energy of each cosmic-ray component is calculated. The possibility of surfatron acceleration of Fe nuclei (Z = 26) in the LIC up to an energy of ECL ~ 1017 eV and electron and positrons to the “knee” in the energy spectrum is predicted. By numerically solving a system of nonlinear equations describing the interaction between an electromagnetic wave and a charged particle with an energy of up to E/Z ~ 3 × 106 GeV, the possibility of trapping, confinement, and acceleration of charged cosmic-ray particles by a quasi-longitudinal plasma wave is demonstrated. © 2017, Pleiades Publishing, Ltd.