  Rydberg arrays merge the collective behavior of ordered atomic arrays with
the controllability and optical nonlinearities of Rydberg systems, resulting in
a powerful platform for realizing photonic many-body physics. As an application
of this platform, we propose a protocol for quantum non-demolition (QND) photon
counting. Our protocol involves photon storage in the Rydberg array, an
observation phase consisting of a series of Rabi flops to a Rydberg state and
measurements, and retrieval of the stored photons. The Rabi frequency
experiences a $\sqrt{n}$ collective enhancement, where $n$ is the number of
photons stored in the array. Projectively measuring the presence or absence of
a Rydberg excitation after oscillating for some time is thus a weak measurement
of photon number. We demonstrate that the photon counting protocol can be used
to distill Fock states from arbitrary pure or mixed initial states and to
perform photonic state discrimination. We confirm that the protocol still works
in the presence of experimentally realistic noise.
