Applications of x-ray absorption near-edge spectroscopy (XANES) and the design of cells for in situ corrosion studies are reviewed. Passive films studies require very thin metal or alloy layers be used having a thickness of the order of the films formed because of penetration of the x-ray beam into the metal substrate. The depth of penetration in water also limits the thickness of solutions that can be used because of water reduces the x-ray intensity. Solution thickness must also be limited in studies of conversion layer formation studies because the masking of the Cr in solution. Illustrative examples are taken from the anodic behavior of Al-Cr alloys, the growth of passive films on Fe and stainless steels, and the formation of chromate conversion layers on Al.