thats basic physics and geometry, based on the fact that any kind of skin or flesh is intransparent to infrared, even otherwise transparent eyeballs are intransparent to it.
and ill let Richard Dawkins explain the geometry issue:
http://www.youtube.com/watch?v=lEKyqIJkuDQ (of course the part where the lens comes in no longer applies to heat pits; the lens would be intransparent to infrared so the pit has to stay open.)
and a physics article about it:
http://phys.org/news76249412.html
you can find many more articles that mention the importance of the geometry of the pit and explaining that the snake figures out the direction by feeling which parts of the pit heat up and which dont. you can find it in physics, biology and herpetology articles.