We present the fabrication and analysis of efficient and highly dispersive gratings for the x-ray and extreme ultraviolet (EUV) regime. We show that an asymmetric-cut multilayer structure can act as a near-perfect blazed grating. The precision and high line density are achieved by layer deposition of materials, which can be controlled to the angstrom level. We demonstrate this in the EUV regime with two structures made by cutting and polishing magnetron-sputtered multilayer mirrors of over 2000 bilayers thick, each with a period of 6.88 nm. These were cut at angles of 2.9°and 7.8°to the surface. Within the 3% bandwidth rocking curve of the multilayer, the angular dispersion of the diffracted wave was in agreement with the grating equation for elements with 7250 and 19,700 line pairs/mm, respectively. The dependence of the measured efficiency was in excellent agreement with a formulation of dynamical diffraction theory for multilayered structures. At a wavelength of 13.2 nm, the efficiency of the first-order diffraction was over 95% of the reflectivity of the uncut multilayer. We predict that such structures should also be effective at shorter x-ray wavelengths. Both the Laue (transmitting) and Bragg (reflecting) geometries are incorporated in our formalism, which is applied to the analysis of multilayer Laue lenses and focusing and dispersing Bragg optics.