Minecraft wiki entry for Rail, associated text: the top of any full solid opaque block (stone, dirt, blocks of gold, etc.), including full-block mechanism components (command blocks, dispensers, droppers, note blocks, and redstone lamps)
the top of an upside-down slab, or upside-down stairs.
any of the above underwater (making the rail waterlogged)