Some days ago I clicked on a link to eurogamer.net with an article about how weapons get licensed(sadly I didnt bookmark the link).
There seems to be a company made by some gun manufacturers just for licensing to games developers which have to pay although they practically do free advertising and even are nearly forced to buy a real gun as a base for their artists to make them look identically and have to get the game approved.
Then there was an example of a game where they nearly copied the look, redacted the names and just used model numbers and then had their lawyers approve every tiny bit to be halfway safe.
The easiest example in the article was about some just making up some fantasy raygun theirself so they didnt have to be in fear of legal trouble.