Technically speaking, a railgun is a projectile-launching method using a pair of electrically conducting metal rails and a sliding armature connecting them. When current flows from one rail to the other through the armature, the Lorentz Affect propels the armature down the rails, carrying a projectile with it. When the armature strikes a stop at the end of the rails, inertia carries the projectile onward. However, in common parlance, a railgun is any gauss gun or coilgun that uses rails to stabilize and guide the projectile down the barrel of the weapon so as to increase accuracy, just as a rifle uses spiral grooves.
Railguns can range from pistol sized up to massive artillery pieces, but most are either shoulder arms or the equivalent of small cannons used on vehicles and space craft. For example, Argus McCall uses a custom-built 15mm railgun as his primary sniper weapon, while most Earth Fleet starfighters have rapid-firing railguns firing 50mm microfusion rounds for use as anti-starfighter weapons also capable of causing massive damage when used to strafe enemy capital ships.