Red and Green
A red light is always on the port side of a boat. If you see a red light coming at you at night, it means the boat is on your boat's right, which means it has the right of way. A green light is on the starboard side of a boat. So if you see green from an oncoming boat, you know it's on your left and you have the right of way.
A white light that can be seen from all perspectives of the boat is supposed to be mounted on the stern, according to U.S. Coast Guard regulations.
A yellow light means the lead boat is towing another boat, according to Elbert S. Maloney's book "Chapman Piloting and Seamanship." Don't go in between the boat that's towing and the boat that's being towed.
Look Out Below
A red-white-red vertical sequence on a masthead means the boat has divers and you should steer clear, according to BoatUS.org.
Other sequences of lights can be important, too. A green light over a white light comes from a fishing boat that is trawling, according to BoatUS.org, which means dragging nets behind the boat. Give it a wide berth.