Generation and detection of Fock states of the radiation field