We relate the observable number of sources per solid angle and redshift to the underlying proper source density and velocity, background evolution and line-of-sight potentials. We give an exact result in the case of linearized perturbations assuming general relativity. This consistently includes contributions of the source density perturbations and redshift distortions, magnification, radial displacement, and various additional linear terms that are small on sub-horizon scales. In addition we calculate the effect on observed luminosities, and hence the result for sources observed as a function of flux, including magnification bias and radial-displacement effects. We give the corresponding linear result for a magnitude-limited survey at low redshift, and discuss the angular power spectrum of the total count distribution. We also calculate the cross-correlation with the CMB polarization and temperature including Doppler source terms, magnification, redshift distortions and other velocity effects for the sources, and discuss why the contribution of redshift distortions is generally small. Finally we relate the result for source number counts to that for the brightness of line radiation, for example 21-cm radiation, from the sources.