Method for the differential measurement of phase shifts induced by atoms in an optical ring cavity