  We study the capability of low-energy cosmic rays (CR) to penetrate into
diffuse clouds when they move from the hot ionized plasma to a cool cloud
embedded in that plasma. The spectrum of CR inside a cloud can be remarkably
different from the the one present in the hot interstellar medium because when
CRs pass through a dense cloud of matter, they suffer energy losses due to
ionization and nuclear interactions. Hence there is a net flux of CRs towards
the cloud that can excite Alfv\'en waves. In turn, self-excited Alfv\'en waves
enhances the diffusion of CRs near the edge of the cloud, forcing CRs to spend
more time in this layer and increasing the amount of energy losses. The final
effect is that the flux of CR entering into the cloud is strongly suppressed
below an energy threshold whose value depends on ambient parameters. For the
first time we use the full kinetic theory to describe this problem, coupling
CRs and Alfv\'en waves through the streaming instability, and including the
damping of the waves due to ion-neutral friction and the CR energy losses due
to ionization and pion production. Differently from previous approaches, this
method allow us to describe the full CR spectrum and the magnetic turbulence
spectrum in the transition region between hot interstellar medium and the
cloud. For the typical size and density of diffuse clouds in the Galaxy, we
find that the flux of particles entering the cloud is strongly reduced below
E~10-100 MeV, while for larger energies the CR spectrum remain unaltered.
