The railgun is a weapon added in ZDoom since v1.17. Although ZDoom itself does not provide weapons or enemies using it, the codepointers are there: A_RailAttack for weapons, A_MonsterRail and A_CustomRailgun for monsters.
The railgun effect in ZDoom classifies neither as a hitscan nor as a projectile attack. It consists in a line that hits instantaneously and pierces through actors, obstacle and enemies alike, until it hits a wall, surrounded by a particle helix. However, autoaim does not work on player rail attacks, so free look is required.
Although real railguns exist, a portable version remains a sci-fi prospect for a number of practical reasons.