Evolution of the X-ray spectrum in the flare model of Active Galactic Nuclei