There was some good discussion about it - Get the closest point on a mesh surface from a free point in space