Railguns are not coilguns. Railguns maintain physical contact between the projectile and the rails for the entire length of the barrel. That's a lot of friction. Friction leads to heat, light, and a puff of smoke from material that has been ablated during the launch, if I were to guess.
This leads to one of the big problems with railguns, which is that you have to replace the rails frequently due to wear and tear.