The gravitational phase factor, which may be used to determine the evolution of a wave function in the WKB approximation, is modified to incorporate the Fermi-Walker transport of the wave function when it is accelerated, for example by a wave guide. The modified phase factor is used to obtain geometrical and topological phases in the interference of two coherent beams around a cosmic string containing mass and intrinsic spin. An exact solution for the string from the Einstein-Cartan-Sciama-Kibble gravitational field equations is used to interpret the topological phases as being due to the fluxes of curvature and torsion inside the string.