The Two-degree Field Galaxy Redshift Survey (2dFGRS) Percolation-Inferred Galaxy Group (2PIGG) catalogue of ∼29 000 objects is used to study the luminous content of galaxy systems of various sizes. Mock galaxy catalogues constructed from cosmological simulations are used to gauge the accuracy with which intrinsic group properties can be recovered. It is found that a Schechter function is a reasonable fit to the galaxy luminosity functions in groups of different mass in the real data, and that the characteristic luminosity L * is slightly larger for more massive groups. However, the mock data show that the shape of the recovered luminosity function is expected to differ from the true shape, and this must be allowed for when interpreting the data. Luminosity function results are presented in both the b J and r F wavebands. The variation of the halo mass-to-light ratio, T, with group size is studied in both of these wavebands. A robust trend of increasing T with increasing group luminosity is found in the 2PIGG data. Going from groups with b] luminosities equal to 10 10 h -2 L ⊙ to those 100 times more luminous, the typical b J-band mass-to-light ratio increases by a factor of 5, whereas the r F-band mass-to-light ratio grows by a factor of 3.5. These trends agree well with the predictions of the simulations which also predict a minimum in the mass-to-light ratio on a scale roughly corresponding to the Local Group. The data indicate that if such a minimum exists, then it must occur at L ≲ 10 10 h -2 L ⊙, below the range accurately probed by the 2PIGG catalogue. According to the mock data, the b J mass-to-light ratios of the largest groups are expected to be approximately 1.1 times the global value. Assuming that this correction applies to the real data, the mean b J luminosity density of the Universe yields an estimate of Ω m = 0.26 ± 0.03 (statistical error only). Various possible sources of systematic error are considered, with the conclusion that these could affect the estimate of Ω m by a few tens of per cent.