The comparison theory for the Riccati equation satisfied by the shape operator of parallel hypersurfaces is generalized to semi-Riemannian manifolds of arbitrary index, using one-sided bounds on the Riemann tensor which in the Riemannian case correspond to one-sided bounds on the sectional curvatures. Starting from 2-dimensional rigidity results and using an inductive technique, a new class of gap-type rigidity theorems is proved for semi-Riemannian manifolds of arbitrary index, generalizing those first given by Gromov and Greene-Wu. As applications we prove rigidity results for semi-Riemannian manifolds with simply connected ends of constant curvature.