He graduated from the United States Military Academy in 1884 and was commissioned second lieutenant in the Second Artillery. He early made himself an authority on ordnance. In 1900, then-Captain Lewis was sent by Adjutant General Henry Clarke Corbin to Europe to study that subject, his report resulting in the re-armament of the field artillery. By successive promotions, he rose to the rank of colonel in the Coast Artillery Corps in August 1913, and was retired the next month for disability incurred in line of duty.
In 1911, he created the Lewis Gun, which was used in World War I by the Allied armies, the United States Navy, and the airplanes of the United States and Allies. Initially the United States Army was not interested in his new gun, but after the British and French had bought more than 100,000 for use in the trenches in France, they did purchase them. He declined the royalties - amounting to at least $1,000,000 - on guns made for the United States after it entered the war.
His other inventions included a time-interval clock and bell system of signals, a replotting and relocating system for coast batteries, an automatic sight, quick-reading mechanical verniers for use in coast defenses, electric car lighting, and windmill electric lighting systems.