The radiation from stars and active galactic nuclei (AGN) creates photodissociation regions (PDRs) and X-ray dominated regions (XDRs), where the chemistry or heating are dominated by far-ultraviolet (FUV) radiation or X-ray radiation, respectively. PDRs include a wide range of environments from the diffuse interstellar medium to dense star-forming regions. XDRs are found in the center of galaxies hosting AGN, in protostellar disks, and in the vicinity of X-ray binaries. In this review, we describe the dominant thermal, chemical, and radiation transfer processes in PDRs and XDRs, as well as a brief description of models and their use to analyze observations. We then present recent results from Milky Way, nearby extragalactic, and high-redshift observations. Several important results are: