Rust is primarily caused by condensation / storing a gun in an environment where its humid / as it cools where you have the gun stored - the moisture will collect on the coldest thing around ( cast iron table tops on tools, gun barrels, etc ).
I'm assuming you're in a maritime community / so the first thing you have to do is clean the barrel - and a couple of things I've tried .... a coat of paste wax will work pretty well / a light coat of oil - like #2 Rig Oil / there are some other products that I use on things like my table saw top - BoeShield T-9 ( I have not tried it on my guns ).
You might try and get a little heat in the area where you store your guns / like a small wattage light bulb inside your safe. Make sure there is good air circulation around the guns in your safe ( don't store guns in a soft sided case, that traps moisture ). If you shoot the guns, on a rainy day - take them apart - clean them, let them dry out ( take stocks off, etc ) - clean, lube them, spray them with Rig #2 or wax them - and it should stop.