A rapid and accurate computational method is introduced for two-point ray tracing in horizontally layered media with constant or linearly varying vertical velocity distributions. The horizontal distance between the source and a receiver can be expressed in a nonlinear form in terms of the takeoff angle at the source, with the use of Snell's law for layered media, in which the velocity of each layer is constant or linear with depth. This nonlinear equation is expanded in a Taylor series with terms up to the second order about the initial value of the takeoff angle of the ray for two-point ray tracing. This expansion yields a quadratic equation with respect to the correction angle, which is the angular difference between the true and calculated takeoff angles at the source or the starting point of the ray. The takeoff angle of the ray is updated in an iterative way by solving this quadratic equation for the correction angle. The initial value of the takeoff angle in the iteration is reasonably estimated by considering geometric aspects of ray paths and dynamic properties of rays. A primary estimation of the initial value is obtained by adjustment of ray parameter values, starting from the takeoff angle of the straight line extending from the source to the receiver and assuming that the media are homogeneous, with a velocity equal to an average velocity obtained by weighting on the ray segment length within each layer along the ray path. An improved initial takeoff angle is obtained from the dynamic properties of the rays in layered medium, such as constancy of the ratio of distances from the central ray to any nearby two rays measured at any points along the central ray so long as the takeoff angle differences among these rays are small. The convergence rate of computation in this method is much faster than that of Newton's method and requires only a few iterations, even for large horizontal distances between the source and receivers. This method also works for layered media that embed low-velocity layers. The computational results show that the initial values of takeoff angle calculated in this article are not far from the true value and provide stable and rapid convergence in two-point ray tracing. Therefore, the accuracy and convergence rate of this method are sufficient enough to be applied to a wide range of seismic problems.