The Chiroptera, or bats, are the second most diverse group of mammals, and are the only mammals ever to evolve true powered flight. The evolutionary origin of chiropterans is still somewhat of a mystery, because the fossil record of bats is scant. Some cladistic analyses indicate that bats are most closely related to the dermopterans, such as Cynocephalus, the colugo or "flying lemur" (which does not fly and is not a lemur). But others suggest that they are not so closely related. However, their ancestors may have been similar in some ecological respects.
Phylogenetic and functional data suggest the inference that the hypothetical ancestor would have been nocturnal, insectivorous, arboreal, and a glider. The earliest known bats appear in the Eocene epoch, and had long tails and other primitive flight adaptations, but were generally similar to modern bats in most ways. We can infer that bats gradually evolved true flight from a gliding arboreal ancestor, possibly using the gliding membrane as a sort of "net" while the flight stroke evolved.
The bat wing (shown above) is made of a membrane supported by the arm and the greatly elongated fingers of the hand, which support the distal part of the wing (where thrust is produced). Bats have such flight adaptations as echolocation (in microchiropterans), keen senses, modified pectoral girdle (at right), reduced radius, large humerus and ulna, clawed fingers, high metabolic rate, and a uropatagium: a membrane stretched between the hindlimbs that helps to stabilize the bat during flight, and often to capture prey with. This is thought to have originally been a gliding adaptation, as most gliders incorporate their hindlimbs into their gliding airfoil. A new bone, the calcar, supports the membrane from the heel (roughly analogous to the pteroid bone in pterosaur forelimbs).
As you may know if you've ever watched bats hunting insects on a cool summer night, many bats are adept and agile flyers, with marvelous adaptations provided by their ancestry and 60-odd million years of history. This youngest group of flying vertebrates is another excellent example both of convergent evolution with the other flyers, and of macroevolution and adaptive radiation. Compared to approximately 140 million years of pterosaur history and 150 million years of bird history, bats are just getting started.