It is believed that the global baryon content of clusters of galaxies is representative of the matter distribution of the universe , and can , therefore , be used to reliably determine the matter density parameter \Omega _ { m } . This assumption is challenged by the growing evidence from optical and X-ray observations that the total baryon mass fraction increases towards rich clusters . In this context , we investigate the dependence of stellar , and total baryon mass fractions as a function of mass . To do so , we used a subsample of nineteen clusters extracted from the X-ray flux limited sample HIFLUGCS that have available DR-7 Sloan Digital Sky Survey ( SDSS ) data . From the optical analysis we derived the stellar masses . Using XMM- Newton we derived the gas masses . Then , adopting a scaling relation we estimate the total masses . Adding the gas and the stellar mass fractions we obtain the total baryonic content that we find to increase with cluster mass , reaching 7-year Wilkinson Microwave Anisotropy Probe ( WMAP-7 ) prediction for clusters with M _ { 500 } = 1.6 \times 10 ^ { 15 } M _ { \odot } . We observe a decrease of the stellar mass fraction ( from 4.5 % to \sim 1.0 % ) with increasing total mass where our findings for the stellar mass fraction agree with previous studies . This result suggests a difference in the number of stars formed per unit of halo mass , though with a large scatter for low-mass systems . That is , the efficiency of star formation varies on cluster scale that lower mass systems are likely to have higher star formation efficiencies . It follows immediately that the dependence of the stellar mass fraction on total mass results in an increase of the mass-to-light ratio from lower to higher mass systems . We also discuss the consequences of these results in the context of determining the cosmic matter density parameter \Omega _ { m } .