Glass frit plays an important role in the silver paste for silicon solar cells. In this work, we prepare glass frit doped with different rare-earth elements (Y, La, Sm, Er) and study how the doping element affects the performance of the solar cells. Solar cells with La-doped and Sm-doped glass frits show average conversion efficiencies higher than 17.5%, while solar cells with Y-doped or Er-doped frit show lower efficiencies. By analyzing the Raman spectra of the rare-earth doped glass frits, we find that the average coordination number of Te–O ([Formula: see text]) in the glass can be tuned by the rare-earth dopant. La or Sm doping leads to a moderate value of [Formula: see text], which is believed to achieve a glass formation ability that optimizes the structure of the Ag–Si interface of the cell for the best performance.