I’m sure you recognize this clip from The Two Towers, in which the beacons are lit in Gondor, to call for help from Rohan.
I believe (I could be wrong) that the inspiration for this plot element in The Lord of the Rings was the following passage from Heimskringla (here in Lee Hollander’s translation) and the Saga of King Haakon the Good:
After this battle King Haakon incorporated into the laws for all the land along the seas, and as far inland as the salmon goes upstream, that all districts were divided into “ship-levies”; and these he parcelled out among the districts…. Along with this it was ordered that whenever there was a general levy, beacons were to be lit on high mountains, so that one could be seen from the other. It is said that news of the levy travelled from the southern-most beacon to the northernmost borough in seven nights.
If anyone knows of an earlier example of such a beacon signalling system, which might have inspired Tolkien, let me know.