How come x-rays can escape from a black hole when visible light can not?
Your thinking is right that visible light and x-rays should follow the curvature of space-time in identical ways, as they are in fact both types of electro-magnetic radiation. The only difference is thet the x-rays have a shorter wavelength and higher frequency than the visible light. They will both be attracted to a black hole in the same way. From within a certain distance, called the Schwartzchild radius, the curvature of space-time is too great for even electro-magnetic radiation to escape; thus the name black hole. Thus matter and energy closer than this distance can never escape to the outside of the black hole (except for quantum "evaporation" of the hole, save that for another question), but things outside the Schwartzchild radius have a chance of getting away if they have enough energy.
Your question may stem from reports that black holes have been found due to x-rays emitted by them. However the x-rays which can be used as a signature of super dense bodies are actuallu emitted from a ring of material which orbits outside the Schwartzchild radius, something like the rings orbiting around Saturn and other planets. As material falls into this disk, and then into the black hole itself, energy is given off which can be detected in the form of x-rays.
Rob Landolfi, Science Teacher, Washington, DC
'I thank You God for this most amazing day; for the leaping greenly spirits of trees and a blue true dream of sky; and for everything which is natural which is infinite.'