As to the Mossberg 500, I have one that has lived in my trunk for many years now. It has been wet, frozen, dropped in the mud, subjected to good old southern humidity, and generally used and abused and it is still going strong. No rust to date- not even one speck. I bet the 500 would be good to have living near the beach.
As to a pistol, Glocks are corrosion resistant, but I personally do not like the trigger. I have had good luck as to corrosion resistence with the following: Springfield XD, Glock, and Ruger SR9. As to the SR9, I have not had it more than a few months, but it has already seen extreme use (I am not easy on my sidearms) and it still looks great. Stainless Steel slide and ploy frame makes it pretty anti-corrosion. I think I paid $450.00 for mine and it is worth every penny. As to the Springfield XD, I carried a Service XD-40 for two years and its finish has held up decently. However, since the finish tends to rub off, I think that exposure to salt-laden air will do a number on it if given enough time. As to the Glock (17), aside from a few scratches it still looks new. My brother has a Glock 40 cal. compact that has lived on his boat (at the coast) for seven years. It has held up well considering what it has been through. To be honest, I do not think any other pistol except for a glock could withstand such repeated contact with salt water and still look and function as it does.
As to lubricants, I love CLP type products, especially the ones by Mil-Tec. Also, I like the plain old gun oil by Hoppes.
Hope this helps out!