Because I've seen a lot of muzzleflashes that look like this:

If you're making this sort of muzzleflash frame you should feel bad; your mother raised you better than that. Notice how it looks like the flash is in front of, but not really æffecting the weapon? That's not particularly believable. The flash should be emitting light of some sort, and that light should be reflecting off of the weapon body.
So to start with, You'll need an advanced image editing program. Paint.NET or Photoshop both have the necessary features, so if you have one of those programs you should be fine.
First, resize the canvas to something much larger than you will need. I suggest keeping the image in the center of your canvas. This isn't super necessary, but it's nice to have some room to move about.
Create a new layer and move it below your weapon. Paste your muzzleflash into this layer and position it underneath your weapon wherever you want it to go.
Go back to the layer with your weapon and select the blank space around it. Invert your selection (so that all of your weapon is selected and none of the background is selected) Select the Layer with your muzzleflash and hit delete. This cuts a gun-shaped hole into the flash. The flash should look like this:

Make a duplicate of your muzzleflash layer and move it above the weapon. Apply a gaussian blur (I usually use a radius of 2 or 3.)
Duplicate this blurred layer a few times (3 or 4 times usually works) and merge them together.
Go to your weapon layer and select the transparent background like you did before, but do not invert your selection this time. Return to the blurred layer and hit delete. What is left should be only over the weapon sprite. It should look something like this:

Now you could stop here, and be done. This is already better than what you had before, but it's not particularly great. The blur shows that there is intense light at the muzzle, but there's also some softer light there as well.
For that light you need to duplicate the weapon layer and make it greyscaled. Select the blank space around the weapon. Invert your selection (so that all of your weapon is selected and none of the background is selected) and create a new layer above the weapon. Select a colour that is close to the colour of the muzzleflash and fill in your selection with it. Set this layer's blending style to "overlay" and merge it onto the grey weapon. You could use gradient maps for this if you wanted. Gradient maps offer more control, but such control isn't always necessary. Use whatever recolouring method works best for you. It should look something like this:

Set the gradient tool to alpha mode and fade down from the center of the weapon's muzzle to some point on the weapon closer to the bottom. It should end up looking like this:

Now you that have all of your layers made, they need to be put in this order:
1. Blur (top layer)
2. Soft Glow
3. Weapon
4. Flash (bottom layer)
Flatten the image. It should look something like this:

At this point you're done. This looks much better than just slapping the flash behind the weapon.
For bonus points, you can add soft light to other surfaces on the weapon (such as the tank on the side of this one) where light should be present, but is not currently. This also applies if the weapon has multiple barrels (such as the SSG) but is only firing from one at a time.
So the end result looks like this:

If there's anything that is unclear or that you feel I should elaborate further upon, don't hesitate to tell me, and as always feedback is appreciated.