What is the rarest LEGO set ever produced?
This question is nearly impossible to answer with all the variables.  You might consider refining your question to a more realistic scope by eliminating sets like "Inside Tour Exclusives", Comic Con Exclusives, single minifigures like the gold C-3PO, or employee exclusives.  

While probably not the "rarest" set out there, the 5004590 "Bat Pod" is annoyingly rare.  Sure you could piece one together, but getting one with the box and instructions is pricey.
(https://www.bricklink.com/v2/catalog/catalogitem.page?S=5004590-1#T=S&amp;O)  



Some of the old HO scale cars in certain colors are extremely rare. I would think that many of the old piece packs/boxes are probably hard to find and/or buy.  

Related: What is the rarest LEGO production element (colour/shape combination)?