The science behind the phenomenon is simply that sodium bicarbonate (as baking soda is known to its friends) is amphoteric; that is, it reacts with substances that have either strong acid or base pHs. Most things that we consider bad smelling in a refrigerator are giving off a vapor of strongly acidic particles, therefore sodium bicarbonate powder, with its large surface area, will react with those particles and neutralize them by making them less acidic. And of course Arm & Hammer will be only too happy to tell you all about this.
So it the science says it works in theory, but a better question might be, does it work really well? I found at least one chemist who doesn't think so:
The popular "open box of Arm & Hammer®
in the refrigerator" simply provides
an adsorbent material that can soak up
odors -- but not very effectively. For
example, if some of the odoriferous
materials floating around in the
refrigerator are acidic, the alkaline
baking soda can absorb and neutralize
the acid. Even in that regard, it is
not all that effective because, as the
powder in the box contacts water
vapor, it tends to crust over an lose
a great deal of its already limited
surface activity.
He goes on to suggest using activated charcoal, though I would add that activated charcoal is much more expensive and should be disposed of more carefully. So while the baking soda may not work quite as well as advertised, it may still be the best option for most people.