Role of rare-earth ions in scintillating materials