The unique characteristics of rare earth elements, attributed to their distinctive 4f electron band, hold significant potential for enhancing the stability and effectiveness of inorganic anticorrosion materials. In this study, rod-shaped samarium-doped zinc oxide solid solution (ZSO) material was synthesized under pure inorganic conditions. The protective effect of the 4f electrons of samarium on the 3d electrons of zinc enhances the chemical stability of the material. Furthermore, the ZSO material exhibited the ability to utilize photogenerated electrons for preventing metal corrosion. Tests have shown that the corrosion resistance of the ZSO composite shield is 78.3% higher than that of the zinc oxide shield and 202.3% higher than that of the epoxy resin coating. Under sunlight, the ZSO composite shield exhibits further improved corrosion inhibition efficiencies of 40% and 100%. The protective effect may be extended to other rare earth and transition metals, leading to the development of more stable and durable materials.