If you drive the nails straight (perpendicular to the surface), then you'll have the end sticking out. If you lay the base of the nail gun flat onto the wood, then the nails will go in on an angle and not stick out the other side. (Ever notice that framing nailers say something like "21 degree framing nailer" in the product description?) This also provides a stronger connection since the nail can no longer easily back out of the hole over the years due to expansion/contraction/vibration, etc. With the nails on an angle the lumber would have to move in a compound angle to slide up the nail.
I just had to go through and reset the ends of the ceiling joists in my garage because the original framers had nailed the ends dead straight into the rafters. Over the the last 25 years the joists began pulling away from the rafters, since the only resistance to movement was the nails, in a straight line. I was able to pull them back into place with a large C-clamp. Now they're nailed on an angle, from both the joist side and the rafter side, so the nails are in an X pattern as viewed from above. To pull apart now will require that the nails actually bend.