A method of obtaining powder diffraction data on dynamically compressed solids has been implemented at the Jupiter and OMEGA laser facilities. Thin powdered samples are sandwiched between diamond plates and ramp compressed in the solid phase using a gradual increase in the drive-laser intensity. The pressure history in the sample is determined by back-propagation of the measured diamond free-surface velocity. A pulse of x rays is produced at the time of peak pressure by laser illumination of a thin Cu or Fe foil and collimated at the sample plane by a pinhole cut in a Ta substrate. The diffracted signal is recorded on x-ray sensitive material, with a typical d-spacing uncertainty of ~0.01 Å. This diagnostic has been used up to 0.9 TPa (9 Mbar) to verify the solidity, measure the density, constrain the crystal structure, and evaluate the strain-induced texturing of a variety of compressed samples spanning atomic numbers from 6 (carbon) to 82 (lead). Further refinement of the technique will soon enable diffraction measurements in solid samples at pressures exceeding 1 TPa.