Codes over Galois rings have been studied extensively during the last three decades. Negacyclic codes over GR(2(a), m) of length 2(s) have been characterized: the ring R-2(a, m,- 1) = GR(2(a), m)[x]/< x(2s) + 1 > is a chain ring. Furthermore, these results have been generalized to.-constacyclic codes for any unit. of the form 4z - 1, z is an element of GR(2(a),m). In this paper, we study more general cases and investigate all cases, where R-p(a, m, gamma) = GR(p(a), m)[x]/< x(ps) - gamma > is a chain ring. In particular, the necessary and sufficient conditions for the ring R-p(a, m, gamma) to be a chain ring are obtained. In addition, by using this structure we investigate all gamma-constacyclic codes over GR(p(a), m) when R-p(a, m, gamma) is a chain ring. The necessary and sufficient conditions for the existence of self-orthogonal and self-dual gamma-constacyclic codes are also provided. Among others, for any prime p, the structure of R-p(a, m, gamma) = GR(p(a), m)[ x]/< x ps - gamma > is used to establish the Hamming and homogeneous distances of gamma-constacyclic codes.