When the phase of the transmittance between a unimodal transmitter and a unimodal receiver is uniformly distributed over

, the density operator of the received signal field commutes with the photon number operator, and the optimum detector of the signal counts photons. A simple formula is given for the probability generating function of the number of photons in terms of the quasi-probability distribution of the transmitted signal. It is used to determine the average error probability of an on-off binary communication system transmitting two-photon coherent-state signals, received in the presence of thermal noise.