When ray picking vertices in OpenGL, how does one exclude hidden vertices?

I always pick the closest vertex, but this vertex may be hidden from view (e.g. behind other objects).
How can I tell if this picked vertex is hidden or not?

Ray picking reference:
http://schabby.de/picking-opengl-ray-tracing/