Why do Catholic churches have a red lamp burning inside? Is there any significance to the red lamp that is lit inside Catholic churches?  

I ask because I recently saw a green lamp lit at the entrance to a Church of Scotland village church and wondered if the lighting of a lamp is common to both Catholic and (some) Protestant churches.  Just curious!
The sanctuary lamp or tabernacle lamp signifies that the Blessed Sacrament is present* in the tabernacle.*cf. Real Presence of Christ in the Eucharist

If it is extinguished,* it signifies there is no Blessed Sacrament the tabernacle.*(like during the Stripping of the Altar at the end of a Holy Thursday service)

Its origins are Exodus 27:20-21:


  Command the children of Israel that they bring thee the purest oil of the olives, and beaten with a pestle: that a lamp may burn always, in the tabernacle of the testimony, without the veil that hangs before the testimony.


They are placed by the tabernacle



or hung on a wall of the sanctuary:



From Rev. William A. O'Brien's Sacristan's Manual for the Extraordinary Form:


  THE SANCTUARY LAMP. This lamp usually hangs in the center of the sanctuary before the tabernacle. It must be kept burning day and night. This is a strict obligation and the sacristan should see that the lamp is ever ready to fulfill its purpose.