A locally ringed space is a topological space equipped with a sheaf of rings, where each stalk is a local ring. This structure is fundamental in algebraic geometry as it allows for the study of geometric objects through their local properties and functions defined on them.