Rail guns use two parallel charged rails which are, usually, forced together beginning from the rear and moving towards the front. As the rails come together, an electromagnetic field forces the projectile lying between the rails to accelerate. Benefits are extremely high acceleration for a given mass (more so than with chemical explosions since you aren't limited by the burn rate of powder, or the gas expansion limits). Problems are the massive power supply and the fact that many rail guns are one-shot deals.
A preferred system is the coil gun, which involves similar principles but a different operating mechanism. The barrel consists of a conducting coil, parts of which are charged in sequence. Because not all of the coil is charged at the same time, the power requirements are much lower. And, because the coil is not being forced together to generate the charge, it's reusable. The Brits were supposed to be working on a tank version years ago.
A Gauss rifle can be either system, since all it implies is that the weapon uses magnetic fields.