We present a revised form of the Percus-Yevick approach applicable to dispersions of interacting colloidal particles such as colloid-polymer mixtures and square-well attractive colloids. Our approach is suitable for treating short-range interparticle potentials including excluded volume hard-sphere repulsion, short-range depletion attraction, and square-well attraction. In all these cases, the Ornstein-Zernike equation for the pair correlation function can be satisfied by a trial function, which generalizes the Wertheim [Phys. Rev. Lett. 10, 321 (1963)] and Baxter [J. Chem. Phys. 49, 2770 (1968)] ansatz. Structure factors (or x-ray scattering intensities) calculated by this method are in good agreement with experimental data for colloid-polymer mixtures over a range of parameters pertaining to the stable fluid phase and the metastable state with moderate attraction. On the same footing, we have determined the stability limits and analyzed contributions to the scattered intensity from particle aggregates appearing prior to the phase separation for sufficiently strong short-range attraction. Similar features are observed in the case of square-well attractive colloids when the attraction is turned on.