This video has been out for a couple months but I found it fascinating.
Charles Limb, a scientist who happens to be a musician decided to investigate what goes on in the brain when someone is improvising jazz and freestyle rap by using an MRI scanner to measure changes in the musicians' brains.
In order to study what happens, he compared brain activity in someone who's playing a memorized solo to someone who is improvising one.
As he himself says, there's very little information on this yet but it appears that when we improvise, we have to shut off one part of our brain that inhibits us and activate an other. In addition, language areas light up and even with your eyes closed there are visual areas lighting up.
Reading the comments on the TED site, I'm struck by how many people—I'm assuming musicians or artists—seem to be threatened by this pulling back of the curtain. They argue that you can't possibly hope to understand creativity or the artistic process and further, science will never be able to create art without the artist.
They're kind of missing the point. There are robots that can probably shoot 3-pointers all day but it never gets old watching a real live human being do it in real time. Nobody's getting replaced here, it's about understanding. Demystifying the physics of shooting that 3-point shot doesn't make the athlete less compelling, if anything it makes them more amazing when you realize everything they're calculating on the fly.
As Limb says in the video, "It's magical but it's not magic."