Rare-earth hydrides RH x show a metal-to-insulator transition for x between 2 and 3. In an ionic picture strong Coulomb interactions between the electrons on H sites are responsible for opening up a gap of ϳ2 eV between the valence bands derived from RH and H-H hybridization and a set of bands of predominantly R-metal d character. We have studied the magnetic polarization near the interfaces of Fe/RH x multilayers (RϭLa, Ce͒ across the metal-to-insulator transition in the hydrides by measurements of x-ray magnetic circular dichroism ͑XMCD͒ at the R L 2,3 edges. The mean Fe-induced magnetic polarization of the R 5d states is considerably reduced in the insulating phase but remains finite. We attribute this to the presence of 5d states induced into the energy gap of the insulator sublayers by Fe, as they result from recent calculations of the electronic structure of ferromagnet/insulator interfaces. Variation of the RH x sublayer thickness reveals that the 5d polarization decays exponentially away from the interface, on a length scale of about 10 Å into the volume of the RH x sublayers, both in the metallic and insulating phase. To our knowledge this is the first experimental observation that metal-induced gap states evanescent into the interior of an insulator may be spin polarized. The identical decay length in both RH x phases, independent of the R element, is remarkable. The R L 2,3 XMCD spectra themselves reveal the complex interplay between the magnetic polarization by Fe 3d and R 5d hybridizations, and the R 4 f magnetic moment. In fact, they are not only related to the magnetic 5d polarization in the ground state, but are largely controlled by the exchange interaction between the 2p core level and the spin polarized 5d band and, in the case of Ce, by the difference between the radial parts of the 2p-to-5d matrix element for the 5d majority and minority spin channels, resulting from the 4 f -5d exchange interaction. It induces a drastic modification of the line shape and even a change in sign when the samples are cooled to low temperature or oriented under different angles with respect to the beam. We present a detailed discussion within a simple phenomenological model.