Electromagnetic signals are always composed of photons, though in the circuit domain those signals are carried as voltages and currents on wires, and the discreteness of the photons energy is usually not evident. However, by coupling a superconducting qubit to signals on a microwave transmission line, it is possible to construct an integrated circuit where the presence or absence of even a single photon can have a dramatic effect. This system is called circuit quantum electrodynamics (QED) because it is the circuit equivalent of the atom-photon interaction in cavity QED. Previously, circuit QED devices were shown to reach the resonant strong coupling regime, where a single qubit can absorb and re-emit a single photon many times. Here, we report a circuit QED experiment which achieves the strong dispersive limit, a new regime of cavity QED in which a single photon has a large effect on the qubit or atom without ever being absorbed. The hallmark of this strong dispersive regime is that the qubit transition can be resolved into a separate spectral line for each photon number state of the microwave field. The strength of each line is a measure of the probability to find the corresponding photon number in the cavity. This effect has been used to distinguish between coherent and thermal fields and could be used to create a photon statistics analyzer. Since no photons are absorbed by this process, one should be able to generate non-classical states of light by measurement and perform qubit-photon conditional logic, the basis of a logic bus for a quantum computer.