We consider the numerical solution of the rational algebraic Riccati equations in Rn, arising from stochastic optimal control in continuous and discrete time. Applying the homotopy method, we continue from the stabilizing solutions of the deterministic algebraic Riccati equations, which are readily available. The associated differential equations require the solutions of some generalized Lyapunov or Stein equations, which can be solved by the generalized Smith methods, of O(n3) computational complexity and O(n2) memory requirement. For large-scale problems, the sparsity and structures in the relevant matrices further improve the efficiency of our algorithms. In comparison, the alternative (modified) Newton s methods require a difficult initial stabilization step. Some illustrative numerical examples are provided.