Galaxy clusters structure, dominated by dark matter, is traced by member galaxies in the optical and hot intra-cluster medium (ICM) in X-rays. We compare the radial distribution of these components and determine the mass-to-light ratio vs. system mass relation. We use 14 clusters from the REXCESS sample which is representative of clusters detected in X-ray surveys. Photometric observations with the Wide Field Imager on the 2.2m MPG/ESO telescope are used to determine the number density profiles of the galaxy distribution out to $r_{200}$. These are compared to electron density profiles of the ICM obtained using XMM-Newton, and dark matter profiles inferred from scaling relations and an NFW model. While red sequence galaxies trace the total matter profile, the blue galaxy distribution is much shallower. We see a deficit of faint galaxies in the central regions of massive and regular clusters, and strong suppression of bright and faint blue galaxies in the centres of cool-core clusters, attributable to ram pressure stripping of gas from blue galaxies in high density regions of ICM and disruption of faint galaxies due to galaxy interactions. We find a mass-to-light ratio vs. mass relation within $r_{200}$ of $left(3.0pm0.4right) times 10^2, h,mathrm{M}_{odot},mathrm{L}_{odot}^{-1}$ at $10^{15},mathrm{M}_{odot}$ with slope $0.16 pm 0.14$, consistent with most previous results.