  We model the effects of shocks on the diffuse, X-ray emitting baryons in
clusters of galaxies. Shocks separate the infalling from the inner gas nearly
at equilibrium, and dominate the compression and the density gradients of the
latter in the dark-matter potential of the cluster. We find that, independently
of the detailed shape of the potential, the density gradient is steeper and the
compression factor larger for the richer clusters. We show, considering the
different merging histories, that in the hierarchical cosmogony the above
effects lead, in X-rays, to a luminosity-temperature relation L \propto T^5 at
the scale of groups which flattens down to L \propto T^{3} for rich clusters in
accord with the observations, and then saturates toward L \propto T^2 for
higher temperatures. From the merging histories we also compute statistical
fluctuations of the L-T correlation.
