The problem of three stars arises in many connections in stellar dynamics: three-body scattering drives the evolution of star clusters, and bound triple systems form long-lasting intermediate structures in them. Here we address the question of stability of triple stars. For a given system the stability is easy to determine by numerical orbit calculation. However, we often have only statistical knowledge of some of the parameters of the system. Then one needs a more general analytical formula. Here we start with the analytical calculation of the single encounter between a binary and a single star by Heggie (1975). Using some of the later developments we get a useful expression for the energy change per encounter as a function of the pericenter distance, masses, and relative inclination of the orbit. Then we assume that the orbital energy evolves by random walk in energy space until the accumulated energy change leads to instability. In this way we arrive at a stability limit in pericenter distance of the outer orbit for different mass combinations, outer orbit eccentricities and inclinations. The result is compared with numerical orbit calculations.