Phase-change materials based on chalcogenide alloys are used in rewritable optical media and are promising materials for non-volatile electronic memories. Both types of devices are based on a) the ability of phase-change materials to undergo reversible and fast transitions between the amorphous and crystalline phases upon heating by a laser or current pulse and b) the strong optical and electronic contrast between the two phases. In spite of their enormous technological importance, the structural and electronic properties of these materials and the mechanisms driving the transitions are still controversial. In the first part of my talk I will present our computational study of the Raman spectrum of two prototypical phase-change materials: GeTe and Ge2Sb2Te5. The spectrum of amorphous GeTe and cubic and amorphous Ge2Sb2Te5 were obtained by ab initio simulations and empirical bond polarizability models. The models of the amorphous phases of these systems were generated by quenching from the melt within ab initio molecular dynamics. The calculated spectra are in good agreement with experimental data and provide strong evidence of the existence of the peculiar local structures of the amorphous phase revealed by recent first-principles simulations, namely tetrahedral Ge and defective octahedral sites for a fraction of Ge and for all Sb and Te atoms. In the second part of my talk I will present some preliminary results on two ongoing projects: a) the study of the crystallization kinetics in GeTe by ab initio molecular dynamics combined with the metadynamics method and b) the investigation of the structural and magnetic properties of Ge2Sb2Te5 doped with magnetic impurities. .