How does targeting work with spray fire?
Solution 1:
The only friendly fire in Frozen Synapse is from your own rockets/grenades. Machine gunners and shotgunners cannot harm friendly units. I'll look through my video logs for something to upload to youtube, but not sure if I have that exact scenario.
As for targeting one enemy and killing another (ie one behind him), I'm 99% sure you cannot kill another enemy unit with "stray" fire. I have a match open and am playing the future turn with a unit directly behind another unit of mine under fire, and he is completely safe. If the future turn ends up like that, I'll upload the video to youtube.
As of now, I don't have any video evidence of either, but will look for it/test for it. But, I'm almost positive that aside from rockets/grenades, units will only kill the enemy unit that they are targeting, not any nearby units, whether they are friend or foe.
Solution 2:
According to the wiki, the kill shot is the only bullet that matters, the rest is just "eye candy" to show that the unit is engaged in combat.