We investigate the band-gap narrowing in silicon caused by the introduction of additional electron carriers together with a neutralizing uniform positive background charge. The local-density approximation (LDA) is shown to be inadequate for calculating the band-gap narrowing. Using a first-principles technique and the GW approximation for the self-energy operator, we show that the change in the screening of the electron-electron interaction is the dominant effect. By employing the nonlocal inhomogeneous and energy-dependent dielectric function of the intrinsic material, we obtain significant corrections at high doping densities to previous model theories that use the simple static dielectric constant. While the inclusion of local-field effects is shown to give a negligible contribution, it is the energy dependence of the dielectric function that gives the main improvement. The inclusion in the screened Coulomb interaction of the ‘‘true’’ wave functions (calculated using the LDA), which we assume the additional carriers to occupy, is found to have no significant effect compared with the results obtained from a calculation using plane-wave functions. This is due to the fact that the changes in the electron-electron interaction occur predominantly at long wavelengths, so that the microscopic details of the wave functions are unimportant.