Today there are many different rail-systems, like the NATO standardized M1913 "Picatinny" rail or the older, and partly compatible Weaver-rail.
The rail was implicitly used in Battlefield 2, Battlefield 2142, and Battlefield: Bad Company 2 for their respective assault rifle attachments.
— In-game description
The Underslung Rail is an attachment featured in Battlefield 3, available for most assault rifles. It allows either the M320/GP-30 or M26 MASS to be mounted to the rifle instead of being used standalone, decreasing the time needed to switch between the two weapons. Any optics mounted to the rifle can also be used with the underslung weapon, though the M26 benefits more from this property. The rail is not available on any of the bullpup style firearm except the AUG A3.
While using the underslung weapon, the soldier carries the weapon in a manner suggesting its use. M320/GP-30 users will tilt their weapon back, while M26 MASS users will flip out the weapon's left-hand bolt.
If a Medkit is selected, the rail will have no effect whatsoever. Also, certain combinations of weapons cannot be mounted together:
— Battlelog description