Ey! Thanks for playing!
Ghosts have a chance to drop a Gun Module that will change your gun and refill your ammo when you touch it. The idea is that the player is forced to constantly change weapons and adapt to their different playstyles. When you have no ammo there is always a new gun package somewhere near you.