A mechanism is proposed to account for the ability of Bi to dope electrically certain chalcogenide glasses. EXAFS experiments have shown that there is a significant change in the local structural environment of the Bi at compositions close to the critical concentration of Bi (10 at. %) at which the p-n transition takes place. These structural changes are interpreted in terms of a model in which, according to the ideas of Fritzsche and Kastner, the charged impurity causes electrical doping by upsetting the equilibrium between native charged defects.