What are the main differences between solar flares and coronal mass ejections? Specifically, what causes them, what sort of damage can they cause, and what are the differences in their composition?
The following definitions are according to NASA.

"Solar Flares" are gigantic explosions from the surface of the Sun, occurring near sunspots along the dividing/neutral line between opposite magnetic field areas.

"Coronal Mass Ejections" (CME's) are:


  huge bubbles of gas threaded with magnetic field lines that are ejected from the Sun over the course of several hours.


Although the Earth's magnetic field protects the biosphere from the worst of these forms of 'space weather', according to the website "Space Weather: What impact do solar flares have on human activities?", the effects that do affect us are:


Disturbance of the ionosphere, disrupting radio communications.
heating, hence expansion of the atmosphere would cause drag on satellites, degrading their orbits, also affecting the accuracy of GPS.


From the Solar Weather site, an important distinction between CME's and solar flares in how they affect the Earth:


  Coronal mass ejections are more likely to have a significant effect on our activities than flares because they carry more material into a larger volume of interplanetary space, increasing the likelihood that they will interact with the Earth. While a flare alone produces high-energy particles near the Sun, some of which escape into interplanetary space, a CME drives a shock wave which can continuously produce energetic particles as it propagates through interplanetary space. When a CME reaches the Earth, its impact disturbs the Earth's magnetosphere, setting off a geomagnetic storm. 


Very severe CME's can also potentially disrupt power grids and communications.