Official rule text as published in the U.S. Coast Guard Navigation Rules
(a) A sailing vessel underway shall exhibit: (i) sidelights; (ii) a sternlight.
(b) In a sailing vessel of less than 20 meters in length the lights prescribed in Rule 25(a) may be combined in one lantern carried at or near the top of the mast where it can best be seen.
(c) A sailing vessel underway may, in addition to the lights prescribed in Rule 25(a), exhibit at or near the top of the mast, where they can best be seen, two all-round lights in a vertical line, the upper being red and the lower green, but these lights shall not be exhibited in conjunction with the combined lantern permitted by Rule 25(b).
(d)(i) A sailing vessel of less than 7 meters in length shall, if practicable, exhibit the lights prescribed in Rule 25(a) or (b), but if she does not, she shall exhibit an all-round white light or have ready at hand an electric torch or lighted lantern showing a white light which shall be exhibited in sufficient time to prevent collision.
(ii) A vessel under oars may exhibit the lights prescribed in this rule for sailing vessels, but if she does not, she shall exhibit an all-round white light or have ready at hand an electric torch or lighted lantern showing a white light which shall be exhibited in sufficient time to prevent collision.
(e) A vessel proceeding under sail when also being propelled by machinery shall exhibit forward where it can best be seen a conical shape, apex downwards. A vessel of less than 12 meters in length is not required to exhibit this shape, but may do so.
Color note: black text applies generally; blue is International Waters; green is Inland Waters.
MyCOLREGS explanation
A sailboat under sail does not show a masthead light.
Summary
Under sail alone, a sailing vessel underway shows sidelights and a sternlight - no masthead light, which is what visually tells you she is not power-driven. Very small sailing vessels and vessels under oars get a fallback: if they cannot show the normal lights, they must at least have a white light ready to show in time to prevent collision, with an inland-only option to instead just carry an all-round white light. The moment a sailing vessel also runs her engine, she must show a masthead light.
Real World Example
Those optional red-over-green masthead lights exist because low, narrow-arc sidelights can be hard to pick out at range or in a seaway, while a light carried at the masthead reaches farther and shows over a wider arc - it lets a sailboat announce herself to a vessel still too far off to see her sidelights at all. Skip the engine, and that missing masthead light is also what tells an approaching powerboat that Rule 18 puts the burden on her, not the sailboat, to keep clear.
Practice Questions
Q1. A sailboat is sailing at night under sail alone, showing sidelights and a sternlight, with no masthead light. Is she in compliance with Rule 25(a)?
A. No - every underway vessel must show a masthead light, whether she is under power, under sail, or both at once.
B. Yes, but only if she is less than 7 meters, since Rule 25 exempts only the smallest sailing vessels from showing a masthead light.
C. Yes - a sailing vessel underway shows only sidelights and a sternlight; the masthead light is what marks a power-driven vessel.
D. No - she is missing her towing light, which every sailing vessel underway at night is required to display alongside her sidelights.
Q2. A sailboat motors into an anchorage after dark with her mainsail still hoisted and her diesel engine in gear. Under Rule 25(e), what light signal is she required to show that tells other boats she is being propelled by machinery?
A. Nothing extra - sail-up always means sailing-vessel lights only, regardless of whether the engine is also running and driving the propeller.
B. A single flashing yellow light, shown forward where the daytime motoring shape would otherwise be displayed under Rule 25(e).
C. Two all-round red lights in a vertical line, the same signal used elsewhere in the Rules to mark a vessel not under command.
D. A masthead light.