According to evolution birds are the defendants of reptiles. Driven by the need to escape predators on the ground the adapted to the air by developing wings. How does a lizard decide it's time to grow wings? Did one fall off a cliff one day and magically sprout wings? Science would clearly say no. So how many lizards tried to fly off cliffs before their subsequent generations began to show signs of wings? Surely every lizard that tried to fly failed or died trying? How did they pass on the adaptive gene process? And the ones that didnt die, how many times in their life span did they jump off "flyable" heights that genetic memory was passed on to the following generations who followed suit with the same dead end results?
That is not how evolution works at all. No lizard decided he needed wings and then grew them, that would indeed be silly. No evolutionary change happened because of a perceived need on the part of the organism, it's all just minute changes to DNA, over millions of years and generations, that eventually let to the variety of species we see today
Evolution happens entirely by chance because of mutations in the DNA. Any mutation in the DNA of an organism that give that organism a better chance of survival will be more likely to be passed down to successive generations. Most mutation are very small, incremental changes
Your lizard did not sprout wings, however a lizard could have had a mutation that gave him some change that made him better suited to his particular environment at that time. That change was not a fully developed wing, but something that later developed into a wing, after many more mutations and many more generations. There were probably gliding animals before actual winged animals.
How exactly wings evolved is a matter of debate among scientists, but there is enough evidence linking winged creatures to their non winged ancestors to know for a fact that wings did in fact evolve.
For more information see http://www.ucmp.berkeley.edu/vertebrates/flight/evolve.html
The most difficult question about the origin of flight is "Why?". "Why" questions are the most difficult ones to ask when they concern evolution; evolution does not ask "why?" Evolution has no sense of future; the here and now is the only place where evolution occurs. It is imperative to keep this in mind when considering the origin of flight. Lineages of organisms are not designed for some future purpose; they are changed by opportunities to which they can respond and by the selective processes that their environment imposes on them. Evolution is limited by developmental and genetic constraints. If an adaptation is useful to a lineage, chances are that it will be preserved. If an adaptation is co-opted from a previous use to a new use, it is called an exaptation. The only scientific way to approach why flight evolved in a group is to first figure out how it evolved; what the temporal sequence of exaptations and adaptations was.
Wikipedia is avery good resource for answers to questions on evolution. I found the information above by typing "how did wings evolve".