Niels Noordhoek who created the 'Bahtinov Grabber' has made a simulation of what occurs with a Carey mask as you go in and out of focus. Watch the green dots - when they are equally spaced perfect focus is reached.
http://www.youtube.com/watch?v=RXIpqEjAXYY