We study the phase transitions occurring in the gravitational clustering of galaxies on the basis of specific heat analysis and Yang–Lee theory. We find that a first-order phase transition occurs when galaxies cluster gravitationally from an initial homogeneous phase, unlike in material sciences. At a critical temperature Tc, the system breaks the symmetry from homogeneity and there is growth of correlation functions from a linear to a non-linear regime. These results are extended to multicomponent systems and extended mass galaxies. It is found that there is little effect of extended mass but appreciable effect of the different mass profiles of galaxies in a multicomponent system. The phase transition for a multicomponent system, dominated by more massive galaxies, occurs at an earlier stage of clustering as compared to a single-component system. The results of Yang–Lee theory of phase transitions applied to the gravitational clustering of galaxies closely match with those from specific heat analysis.