In this paper, we study the theory of geodesics with respect to the Tanaka-Webster connection in a pseudo-Hermitian manifold, aiming to generalize some comparison results in Riemannian geometry to the case of pseudo-Hermitian geometry. Some Hopf-Rinow type, Cartan-Hadamard type and Bonnet-Myers type results are established.