We report measurements of double radiative capture in pionic hydrogen and pionic deuterium. The measurements were performed with the RMC spectrometer at the TRIUMF cyclotron by recording photon pairs from pion stops in liquid hydrogen and deuterium targets. We obtained absolute branching ratios of $(3.02 pm 0.27 (stat.) pm 0.31 (syst.)) times 10^{-5}$ for hydrogen and $(1.42 pm ^{0.09}_{0.12} (stat.) pm 0.11 (syst.)) times 10^{-5}$ for deuterium, and relative branching ratios of double radiative capture to single radiative capture of $(7.68 pm 0.69(stat.) pm 0.79(syst.)) times 10^{-5}$ for hydrogen and $(5.44 pm^{0.34}_{0.46}(stat.) pm 0.42(syst.)) times 10^{-5}$ for deuterium. For hydrogen, the measured branching ratio and photon energy-angle distributions are in fair agreement with a reaction mechanism involving the annihilation of the incident $pi^-$ on the $pi^+$ cloud of the target proton. For deuterium, the measured branching ratio and energy-angle distributions are qualitatively consistent with simple arguments for the expected role of the spectator neutron. A comparison between our hydrogen and deuterium data and earlier beryllium and carbon data reveals substantial changes in the relative branching ratios and the energy-angle distributions and is in agreement with the expected evolution of the reaction dynamics from an annihilation process in S-state capture to a bremsstrahlung process in P-state capture. Lastly, we comment on the relevance of the double radiative process to the investigation of the charged pion polarizability and the in-medium pion field.