The polarization of direct photons produced in an ultrarelativistic heavy-ion collision reflects the momentum anisotropy of the quark-gluon plasma created in the collision. This paper presents a general framework, based on the photon spectral functions in the plasma, for analyzing the angular distribution and thus the polarization of dileptons in terms of the plasma momentum anisotropies. The rates of dilepton production depend, in general, on four independent spectral functions, corresponding to two transverse polarizations, one longitudinal polarization, and -in plasmas in which the momentum anisotropy is not invariant under parity in the local rest frame of the matter -a new spectral function, ρn, related to the anisotropy direction in the collision. The momentum anisotropy appears in the difference of the two transverse spectral functions, as well as in ρn. As an illustration, we delineate the spectral functions for dilepton pairs produced in the lowest order Drell-Yan process of quark-antiquark annihilation to a virtual photon.