Realistic simulations of radiative magneto-convection in the solar (sub)photosphere are used for a spectral synthesis of Fraunhofer's G band, which is dominated by spectral lines from the CH molecule. It is found that the spatial pattern of integrated G-band brightness closely matches the spatial structure of magnetic flux concentrations in the convective downflow regions. The brightness contrast is mainly caused by the weakening of CH lines due to the reduced CH abundance and the resulting shift of the optical depth scale in the hot and tenuous magnetic flux concentrations. Various properties of the synthetic brightness images agree well with G-band observations. These results lends credit to the observational usage of G-band bright features as proxies for magnetic flux concentrations in the solar photosphere. However, the converse is only correct in a limited sense: only a fraction of the magnetic flux concentrations turn out to be bright in the G band.