We study the atomic structure and the electronic and optical properties of Ge(2)Sb(2)Te(5) in two different crystalline states of cubic and hexagonal structures with the use of ab initio pseudopotential density functional method. It is found that electronic and atomic structures are very sensitive to the layer sequence in the two phases. The proximity of vacancy layer to Ge layer leads to the splitting of Ge-Te bond length, which, in turn, affects the electronic and optical properties. The effect of Te d orbitals is also investigated with respect to structural properties