We present a new method to extract the intermediate scattering function from series of coherent diffraction patterns taken with 2D detectors. Our approach is based on analyzing speckle patterns in terms of photon statistics. We show that the information obtained is equivalent to the conventional technique of calculating the intensity autocorrelation function. Our approach represents a route for correlation spectroscopy on ultrafast timescales at X-ray free-electron laser sources.