We show that the use of a matrix inversion scheme based on a special lower triangular-upper triangular factorization rather than on the standard Gaussian elimination significantly improves the numerical stability of T-matrix computations for nonabsorbing and weakly absorbing nonspherical particles. As a result, the maximum convergent size parameter for particles with small or zero absorption can increase by a factor of several and can exceed 100. We describe an improved scheme for evaluating Clebsch-Gordon coefficients with large quantum numbers, which allowed us to extend the analytical orientational averaging method developed by Mishchenko [J. Opt. Soc. Am. A 8, 871 (1991)] to larger size parameters. Comparisons of T-matrix and geometrical optics computations for large, randomly oriented spheroids and finite circular cylinders show that the applicability range of the ray-tracing approximation depends on the imaginary part of the refractive index and is different for different elements of the scattering matrix.