You have two parallel rails (thus called a railgun) and a moveable projectile that is also like a wire. An electric current goes down one wire, across the projectile and then back down the other rail. ... This magnetic field then pushes on the projectile with the current running through it to propel it out of the railgun.