Rail can only be placed on the ground or on the side of a solid block. If placed adjacent to a solid block on the same level, it will angle up toward the top of that block. If the adjacent block is removed, the angled rail will lay flat. If the lower blocks are at the same level, the slope will extend out up to two blocks (a gentler 26 degree slope instead of 45 degree).
Placed rails can be removed by tapping on them using a crowbar or by removing the block underneath; the former sends the removed rail to the acting Blockhead's inventory, the latter drops it in that place.