We propose a new method to create two-photon states in a controllable way using interaction between the Rydberg atoms during the storage and retrieval of slow light. A distinctive feature of the suggested procedure is that the slow light is stored into a superposition of two atomic coherences under conditions of electromagnetically induced transparency (EIT). Interaction between the atoms during the storage period creates entangled pairs of atoms in a superposition state that is orthogonal to the initially stored state. Restoring the slow light from this new atomic state one can produce a two photon state with a second-order correlation function determined by the atom-atom interaction and the storage time. Therefore the measurement of the restored light allows one to probe the atom-atom coupling by optical means with a sensitivity that can be increased by extending the storage time. As a realization of this idea we consider a many-body Ramsey-type technique which involves pi/2 pulses creating a superposition of Rydberg states at the beginning and the end of the storage period. In that case the regenerated light is due to the resonance dipole-dipole interaction between the atoms in the Rydberg states.