|MadSci Network: Neuroscience|
I assume that you are refering to what happens when someone receives a blow to the head (or to the body!) and sees something that really doesn't exist. In physiological parlance, this is known as an "inadequate stimulus." This means that the neurons that would normally signal the presence of an image (or little stars, in this case) have somehow been abnormally stimulated. This is not hard to do. In fact, you can artificially stimulate your retina by closing your eye and pushing gently on the lateral side. You will see an area of brightness due to the pressure exerted on the neurons of your retina. The pressure is, in this case, the "inadequate stimulus." It is likely that people "see stars" as a result of some minor trauma to the brainstem, the optic nerve or the occipital cortex. All of these areas are involved in the processing of visual images. Therefore, artificial stimulation of these neurons will certainly be in an "abnormal state." Other areas can be affected, too, although this does not have to be the case. It is possible for people to feel nausea at the same time they are "seeing stars," probably resulting from inadequate stimulation of other sensory neural pathways, as well.
Try the links in the MadSci Library for more information on Neuroscience.