Raman scattering and theoretical studies of Jahn—Teller induced phase transitions in some rare-earth compounds