We present a method for controlling the spatial properties of high-harmonic beams with high efficiency. The high nonlinearity of harmonic generation allows weak control beams to induce a phase mask for the extreme UV light as it is formed. We fabricate a phase grating and demonstrate efficient diffraction in the far field. Diffractive elements formed in this way are transient. Since they are induced by the subcycle interaction of the medium with the fundamental and control fields, they can be extended to the attosecond time scale.