Casting measurement rays from vertices

Hello! I need to measure the distance along a certain axis from a vertex to the nearest surface of an object of the scene (that must be not itself). Is there a function to cast a ray that stops when finds an obstacle and returns the distance?
Or what method could I use instead?

Thankyou!

There is ray_cast() from objects and closest_point_on_mesh().
http://www.blender.org/documentation/blender_python_api_2_63_5/bpy.types.Object.html?highlight=cast