A few things if I may add to some really good conversation:
If you are running a semi automatic, and it is still relatively new and being broken in, run it wet at first.
What I mean by that is make sure the rails and the slide have some oil or grease on them.
Run it this way for the first 500 rounds or so.
This is critical if you are running a 1911, particularly one that is tight like a Kimber or Les Baer.
After your range session clean the gun to get the lube, powder and grit off it. Then put a light coat of oil or grease on the rails and frame, work the slide a few times, and then wipe any excess off the exterior. Don't store it super lubed, that will attract dirt. Rubbing a silicone impregnated cloth on your pistol before putting it back in the safe is also a great way to store it and a little piece of mind versus corrosion.
Once the pistol is broken in, you should not have to lube it heavily before your next range session, or for carry. Work the slide, and make sure it feels smooth.
Spraying lube in a gun that is fully assembled, and on the gun is just plain moronic. The instructors that did that had a reachable moment there, one that they needed to be the ones doing the learning.
I am currently in the process of putting 500 rounds of .45acp through my new Sig Sauer P227 SAS. It will be my carry gun, but the barrel is fit really tight to the slide. I am making sure I am following the process I outlined above.
When I am preparing to go to the range, I grease the slide and the rails lightly. Work the slide about 10 times. Put it in the range bag and head out. I put 100 rounds through it at the range twice. So far it has run perfect. I bring it home, spray it liberally with Ballistol after disassembly. I leave it for about 10 minutes, let the Ballistol soak in and penetrate. I then wipe every thing down, clean the barrel with a brush and patches, then lightly oil the slide and frame rails. Work the slide 10 times, wipe the gun off, and put it away.