Magical weapons are a feature of many (if not all) roleplaying games. Lewis Carroll gave us the vorpal sword. Star wars gave us the light saber (if you don't think that thing is magical talk to a physicist!) SF games with a harder sort of science shy away from such things and compensate with more 'dakka' (though an SMG with a 100 round clip firing 10,000 rounds a minute has its own sort of magic.)
But getting back to the so-called magic weapons there are few hard facts given about how they work. Are they sharper, preternaturally lighter to wield or do they have AI (artifact intelligence) letting them compensate for ham fisted humans' lack of skill? I never really asked myself how it worked even when I was running a fantasy campaign, but I'm asking now.
In magic as in all things the simplest way of getting the results you want is usually the best. You could make a sword and enchant it plunging it into dragon's blood to make it supernaturally hard and sharp. But some say the hand wielding the weapon is more important than the weapon itself. Perhaps the best way to make a better sword is to make it get the best out of its wielder. If enchantments can make a warrior think friends are foes they can make him think he's a better warrior. Confidence, bravery, fighting spirit can make a warrior more effective.
So maybe just maybe that sword isn't a better sword; maybe it makes the user a better fighter, more focussed and assured which carries over to his fighting. His belief could be so strong enough to hurt creatures otherwise invulnerable (belief is a pretty strong factor in many settings.)
This approach can certainly be used in SF settings. Have your rifle or pistol inject measured doses of Combat or Slow drugs. If you want a less chemically friendly approach a weapon could use neural feedback to elevate the user's confidence and serotonin levels. At higher tech levels a weapon or device might use psionic means. This leads of course to the subject of abuse. It could be as simple as sending a jolt to the pleasure center of your brain every time you fire at something the sight tells you is an enemy.
If you have a weapon that can tell you you're great, it can also whisper in your ear (or whatever you hear with) about how great your cause is and how you should kill anyone opposing it. The more you use that weapon the more loyal you become. So maybe rebels, space pirates and assorted antisocial types should think twice before they loot that government armory.