Then the ultimate weapon - in an early Star Trek episode Kirk and Spock find a pistol sized device that turns out to be a matter to energy direct conversion device.
I don't remember that episode, but this sounds like Star Trek stole an idea from a Larry Niven story. IIRC, humans and Kzinti found what they thought was an old Slaver weapon, but it was a Tnuctipun artifact - a morphing handgun. One of the things it did was convert matter to energy . . . you really did NOT want to be anywhere nearby.
Niven's characters also had the "Variable Sword" a device that sent out a thin wire - thin as in one molecule wide - encased in a stasis field. It would cut through anything.
If we're looking at things beyond handguns, E.E. Smith had some doozies in his "Lensman" and "Skylark" books. In the former, he had the Sunbeam - a ray that harnessed ALL the output energy of a star, which could then be directed against an enemy. His guys also used planet-sized chunks of negative matter against enemy planets - sometimes warped out of a parallel universe where the rest state was 15x lightspeed in our universe. (Even the Arisians couldn't figure out what would happpen beforehand.) And in his Skylark books, fourth-dimensional translation was used to take stars from one galaxy and drop them on all the suns in the galaxy of the evil chlorine-breathing amoeboid monstrosities threatening humanity, wiping out a whole galaxy full of them ("Doc" Smith wrote on a grand scale.)
Heinlein had a book in which his characters had a "tunable" death ray, so you could set it to kill, say, only Orientals. Which was handy since the USA had been invaded by Pan-Asians. (Heinlein took this idea from an earlier John W. Campbell novel titled "All.")
And of course, John W. Campbell came up with the ultimate weapon in his book, The Ultimate Weapon. Basically, when fighting a losing battle against aliens, a human scientist had an idea that, when he computed it out, always reduced to the Heisenberg Uncertainty Principle. Unable to resolve this, he figured he'd build the machine anyway . . . and he ended up with a device that generated uncertainty. Contact with the top level of uncertaintly caused matter - and mankind's enemies - to cease to exist.