Square A is exactly the same color as square B. No kidding.
Our visual systems are old pros at tricking our consciousness. What’s going on here is a simple case of lightness constancy: our visual system is designed to feed us not merely raw data, but a useful interpretation of what we see. This process is what allows the pages of a book to appear “white” in both bright sunlight and leafy shade, despite the change in the amount of light reflected from the pages.
For an explanation of this illusion, created about ten years ago by Edward H. Adelson, refer to this page at MIT. The illusion also has its own Wikipedia page. Adelson’s Lightness Perception and Lightness Illusions (Chapter 24 from M. Gazzaniga’s The New Cognitive Neurosciences) is a fairly technical treatment of lightness constancy. Meredith Talusan and Janice Chen have created Flash animations of the illusions in Adelson’s chapter, so if you don’t particularly care about Metelli’s episcotister model, you can go straight to the pretty pictures.
I’ve seen this principle illustrated before, but can usually force my brain to accept “reality.” On this one, I just couldn’t make myself accept that the squares are the same color, until I took off my glasses. When the sharp grid of the checkerboard and the letters “A” and “B” are too blurry to be visible, suddenly the two squares do appear the same color! Try taking off your glasses (and/or squinting to distort your vision) and see if it works for you, too.
Thanks to Parseval for suggesting this checkerboard illusion in a comment.