It has been known since the mid 1800s that many species of dinosaur had 'feathers'. Until the 1970s, it was widely assumed that the evolution of feathers happened concurrently as animals became able to 'glide' or fly.
In the 1970s, fossils of several species of theropod dinosaurs - which by their anatomical structure clearly could not have flown - were found to be covered in well-developed feathers. These discoveries led biologists to consider the possibility that feathers had evolved not to 'enable' flight, but that some of the dinosaur species exploited the fact that they already had them in order to attempt flight.
There are now several theories regarding feather's evolutionary history. These include the idea that they evolved as :
What is known is that feathers evolved from gradual modifications to already-existing scales.
See: Wikipedia
Also see : Avian flight evolutionplugin-autotooltip__plain plugin-autotooltip_bigAvian flight evolution
It's now widely agreed that modern-day birds evolved, during the Mesozoic Era, from dinosaur species which survived the Cretaceous / Tertiary extinction event. (See: Avian K-T survival )
But the question of how and why birds acquired the ability to fly is still being debated.