The information in
ghost006's writeup is false, one of many attempts to
romanticize the story behind what is one of the military's most famous
bugle calls.
Union General Danial Adams Butterfield wrote "Taps" while camped at Harrison Landing, Virginia, near Richmond in 1862. Butterfield hummed "Taps" to an aide, who wrote down the notes, and had his brigade buguler Oliver W. Norton play them back. After some modification, Butterfield was finally happy with the melody, which was then used for "lights out" instead of the traditional music, the French "L'Extinction des feux". It was given the name "Taps" after the 3 drum taps which signalled that "lights out" was in effect. The other brigades (even Confederates) loved the melody so much they that too adopted it.
"Taps" was first played at a military funeral soon aftwerward. The following is its first reported use: Union Captain John Tidball ordered it played for the burial of a cannoneer killed in action. Fearing that the Confederates would hear the usual rifle volley (thus giving away their location), "Taps" was substituted as a proper send-off for the soldier.
I recommend Michael Shaara's The Killer Angels as a beautiful fictionalization of the Battle of Gettysburg, complete with scads of factual information, including some about Butterfield. The war had so many amazing stories that I feel false legends such as the "Taps" story add nothing to the historical understanding of the emotions and heavy-handedness of the time.
The name "Taps" was not given to the melody until 1874. It is still used to mark the end of the soldier's day, and, appropriately, the end of his earthly journey.
"Taps" has no official lyric, although the following is in relatively common use:
Fading light dims the sight,
And a star gems the sky, gleaming bright.
From afar drawing nigh -- Falls the night.
Day is done, gone the sun,
From the lake, from the hills, from the sky;
All is well, safely rest, God is nigh.
Then good night, peaceful night,
Till the light of the dawn shineth bright;
God is near, do not fear -- Friend, good night.