|For the unique weapon appearing in Fallout 4, see Spray n' Pray.|
Spray and Pray reduces the damage you do to your companions by 75% (in other words, you only do a quarter of your normal damage to allies). It is primarily useful for rapid fire weapons used outside of V.A.T.S. (low critical hit chance weapons with a large area of effect, spread or high rate of fire) and Explosives skill weapons.
It is similarly effective at protecting companions from Meltdown and Heavy Handed automatic attack weapons such as the thermic lance and chainsaw, though on the latter two weapons it does not prevent them from being knocked around by Super Slam!
Behind the scenes
"Spraying and praying" is a term used to describe someone firing an automatic weapon at an opponent in long bursts with little to no regard for accuracy.