  We present Chandra X-ray measurements of the gas mass fraction out to r500
for a complete sample of the 35 most luminous clusters from the Brightest
Cluster Sample and the Extended Brightest Cluster Sample at redshift
z=0.15-0.30. The sample includes relaxed and unrelaxed clusters, and the data
were analysed independently using two pipelines and two different models for
the gas density and temperature. We measure an average of fgas(r500) = 0.163
+/- 0.032, which is in agreement with the cosmic baryon fraction (Omega_b /
Omega_M = 0.167 +/- 0.006) at the 1-sigma level, after adding the stellar
baryon fraction. Earlier studies reported gas mass fractions significantly
lower than the cosmic baryon fraction at r500, and in some cases higher values
that are consistent with the cosmic baryon fraction towards the virial
radius.In this paper we show that the most X-ray luminous clusters in the
redshift range z=0.15-0.30 have a gas mass fraction that is consistent with the
cosmic value at r500.
