Use Extrude to create a surface in the form of a profile curve traveling along a path curve. It does not have the continuity options of the Rail surface tool.
If the path curve has severe bends or corners, the extruded surface can have unwanted twists.
To correct this problem, use the Object Edit > Insert tool to increase the number of edit points/CVs on the path curve in the problem areas, so that transitions between CVs are more gradual.