We discovered that yttrium-, lanthanum- and rare earth-hydride films e
xhibit remarkable optical properties near their metal-insulator transi
tion: the dihydrides are metallic and shiny while the trihydrides are
semiconducting and transparent. The transition between the shiny and t
ransparent state is reversible and can simply be induced by changing t
he H-2 gas pressure or the voltage in an electrolytic cell. No deterio
ration of the films is detected if they are protected by a thin pallad
ium caplayer. The optical switching is also observed in hydrides of al
loys of Y and La. Several theoretical models leading to an insulating
and transparent trihydride state are discussed.