  A general relationship is presented between the statistics of thermal
radiation from a random medium and its scattering matrix S. Familiar results
for black-body radiation are recovered in the limit S to 0. The mean photocount
is proportional to the trace of 1-SS^dagger, in accordance with Kirchhoff's law
relating emissivity and absorptivity. Higher moments of the photocount
distribution are related to traces of powers of 1-SS^dagger, a generalization
of Kirchhoff's law. The theory can be applied to a random amplifying medium (or
"random laser") below the laser threshold, by evaluating the Bose-Einstein
function at a negative temperature. Anomalously large fluctuations are
predicted in the photocount upon approaching the laser threshold, as a
consequence of overlapping cavity modes with a broad distribution of spectral
widths.
