We develop an analytical theory of chaotic spiral arms in galaxies. This is based on the Moser theory of invariant manifolds around unstable periodic orbits. We apply this theory to the chaotic spiral arms, that start from the neighborhood of the Lagrangian points L1 and L2 at the end of the bar in a barred-spiral galaxy. The series representing the invariant manifolds starting at the Lagrangian points L1, L2, or unstable periodic orbits around L1 and L2, yield spiral patterns in the configuration space. These series converge in a domain around every Lagrangian point, called "Moser domain" and represent the orbits that constitute the chaotic spiral arms. In fact, these orbits are not only along the invariant manifolds, but also in a domain surrounding the invariant manifolds. We show further that orbits starting outside the Moser domain but close to it converge to the boundary of the Moser domain, which acts as an attractor. These orbits stay for a long time close to the spiral arms before escaping to infinity.