On August 7, 1789 the U.S. Congress approved an Act for the establishment and support of lighthouses, beacons, buoys, and public piers.
The most famous and possibly the first lighthouse was the Lighthouse of Alexandria built on Pharos island in Egypt. It was built in 280 BC and is estimated to be about 120 meters (400 feet) in height.
The Golden Age of Lighthouses began in the 17th century and they were essential to maritime navigation for centuries. They were also very labor intensive. Lighthouse keepers needed to trim the wicks, replenish fuel, wind clockworks and perform maintenance tasks like cleaning lenses and windows.
In 1907 Nils Gustaf Dalen invented a sun valve which turned the beacon off and on using daylight. He was awarded the Nobel Prize in Physics for the invention of automatic valves designed to be used in combination with gas accumulators in lighthouses.
These and other improvements led the phasing out of lighthouse keepers. In the U.S., the last keepers were removed in the 1990s. In Canada, however, this trend has been stopped and there are still 50 staffed light stations in that country. The rationale is that keepers also serve as a rescue service if needed.
Modern lighthouses are mainly found in inaccessible locations and are more functional and less picturesque. They generally used a solar-charged battery and have a single flashing light.
Now that lighthouses are no longer essential to navigation their maintenance and preservation has fallen into the hands of many non-profits groups around the world.
The best directory of lighthouses that I could find is at this site sponsored by the University of North Carolina.
This image is a drawing of the Pharos of Alexandria by German archaeologist Prof. H. Hermann Thiersch (1909) and is in the public domain.