None of these really tiny microscopes use any kind of light, because photons don't mean anything at that scale.
"Atomic Force Microscopes" (AFMs) basically work by 'poking' the object and sensing the repulsion force.
"Scanning Tunnelling Microscopes" (STMs) work by passing a tiny, tiny current between the 'probe' and the object. They raise and lower the probe to keep the current at a constant value, and the contours of that motion are the result.
(These explanations are both lies-to-children. If you do a PhD in Atomic Physics you might come to understand what really is going on here, or your head might explode.)