I swear by slipstream weapon lube. Sometimes I'll use hoppes 9 as well but my rifle and handguns get a good slipstream treatment on all the rails and moving parts on a regular basis. Haven't had any problems with it gumming up either
Here's a 'Lubrication 101' article by Grant Cunningham that gives a good pro & con of different types of lubrication. He's not trying to sell any particular brand & pretty well leaves it up to the reader what will work best or him.