Manning the rail is a method of saluting (or rendering honors) used by naval vessels.
The custom evolved from that of "manning the yards", which dates from the days of sail.
Today, the crew are stationed along the rails and superstructure of a ship when honors are rendered.
A similar but less formal ceremony is to have the crew "at quarters" when the ship is entering or leaving port.
[1] Manning the rail is also the traditional way to honor the USS Arizona Memorial when it is passed by all U.S. Navy, U.S. Coast Guard and U.S.