MSRP includes a margin of 25-35%, but nobody sells at MSRP. Most new guns go for 10-15% above cost, which isn't enough to keep the business afloat by itself. But you can't have much of a gun store without guns, so they are in effect a promotional item to draw people into the store and get them to buy clothing, supplies and accessories which do have enough profit margin so you have a chance to turn a profit.
Most ammo is even worse. The local Walmart sells some ammo retail at less than a small shop's cost, and the rest just above. The only ammo you can sell at a profit is the more obscure loads they don't carry.