There's a relatively obscure medical condition called Charles Bonnet Syndrome. It happens to people who are either losing their sight, or completely blind. Suddenly, one day, they see vivid and detailed hallucinations. It's been documented since the 1700s, and even today nobody is quite sure why it happens.
Charles Bonnet, according to anyone who knew him, was a hell of a guy. He was a lawyer by trade, but on the side he first studied entomology, then botany, and finally philosophy. The reason for his shift of interests was his steadily waning eyesight. The poor guy did as best he could with what he could see. He lived with his wife, but got on well enough with his family that his niece regularly visited him. One day she came in with two handsome men in rather unusual dress. Bonnet asked her, genially, who her companions were. She looked confused, and told him that she had no companions. There was no one there. Bonnet began to realize that, as his brain grew starved for information, it just made something up to cover whatever its functioning senses were telling it. He wrote about the condition, which has since been known as Charles Bonnet Syndrome.
The typical CBS patient is an older person who is losing their sight due to macular degeneration or some other eye damage. They don't need to be completely blind - although some are. Estimates of the frequency of CBS swing wildly between less than one percent and nearly forty percent of people whose sight is impaired. (Many people, concerned that they'll be institutionalized, don't report it.) The syndrome can be something as simple as shapes or floating lights. Sometimes they can be fantastical. One blind woman with CBS reported seeing entire scenes of people in middle-eastern dress walking around in a foreign setting in front of her. Sometimes, though, the hallucination is like the one Charles Bonnet saw, so realistic and plausible that it fools them into responding. One man with CBS complained that he once saw a spider that he tried to kill before realizing it wasn't there. Another man's wife complained because he was picking invisible insects out of his food. He would also see friends of his sitting in an arm chair next to his bed.
Some people even report CBS in only one eye. One man lost the use of his right eye as an adult, and complained that in that eye he could always see a face. Eventually he began losing vision in his left eye as well, at which point he saw an entire crowd of faces. Some people are entertained, or at least not bothered, by their hallucinations. For those that are, there are treatments, including serotonin reuptake inhibitors. However, Charles Bonnet Syndrome isn't usually a consistent occurrence. Most people find that it can only happen once, or happens sporadically for short times before fading away again.
Most scientists stress that, although the behavior can be worrying or lead to some strange interactions, it's not dangerous. The CBS patients aren't delusional, and acknowledge that the things they see aren't there. Although sometimes they help determining whether an odd object really is there, they aren't in danger. Their brain just has a creative way of solving the problem of its lack of vision.