Thermodynamic aspects of the synthesis of thin-film materials for solar cells