What is the optimal escape trajectory from near a black hole? Consider a space ship that is being drawn closer to a black hole.  The crew begins to notice the effects, and discovers that they are nearing the black hole.  They then manage to halt their progression toward the black hole.  What would be the optimal escape trajectory, assuming they have not yet wandered too close?  I am thinking it would likely either be directly away from the black hole (figure 1), or parallel to the black hole (figure 2).  However, it is conceivable that there would be some other angle that would be optimal (e.g. 45 degrees in figure 3).

Figure 1: Go directly away from the black hole



Figure 2: Go "parallel" to the black hole



Figure 3: Go 45 degrees from the black hole



A follow up question is, would this answer be the same for other high gravity objects, such as neutron stars, or even regular stars?

Let's say for simplicity sake that they have already managed to halt their advance toward the black hole and they are now still (not moving) in relation to the black hole. If distance factors in, it would be interesting to see what the answer is at different distances (e.g. fairly close to the event horizon where I realize a tremendous amount of energy would be required, and for far away).
I'd like to know a little more about the geometry of the ship's trajectory. I would be asking for clarification in comments but I don't know how to put images in comments.

A good distance away the ship is moving nearly a straight line with regard to the large mass. As the ship gets closer the path gradually bends towards the large mass. If you're still a fair distance from the star, the path can be fairly well modeled with Newtonian mechanics and the curving path can be modeled as a hyperbola. The straight line the hyperbola is gradually deviating from is called an asymptote:



This illustration (page 36 of my coloring book) is a hyperbola about the earth, but it could also be a hyperbola about a larger mass.

Escape velocity climbs as you get closer to the mass. The hyperbola's speed is sqrt(Vescape^2 + Vinf^2). I use this right triangle and the Pythagorean theorem as a memory device:



If you did a burn in the opposite direction from your Vinf vector, it could reduce your Vinf and drop you even closer to the mass.

If your burn vector is at right angles to your velocity vector, it would increase your vinf (and thus raise point of closest approach aka periapsis). It would also change the direction of the hyperbola's asymptote.

To better answer your question, I'd need to know more about the geometry of this scenario, what Vesc and Vinf is and how much delta V the ship was capable of. It would be helpful to know at what distance our heroes discover they're in trouble.

If the ship has already fallen close enough that it's traveling an appreciable fraction of c, the above doesn't apply. Conics from Newtonian mechanics is a good approximation until you get too close to the black hole. Then you'd need general relativity to model the trajectory -- and that's above my pay grade.