I will start with some stuff that's not directly related to mathematics, but very relevant, at least for me.
From my perspective, first and foremost you should try to make sure you've had a good night's sleep, and if not, try to take a short nap before the lecture. I've had cases when I couldn't follow any lecture, at all, after having slept for 0 to 3 hours, but after having a 15-minute nap while on a break (or even during the lecture in some more extreme cases), I had no trouble listening and participating.
Second thing is, make sure you eat well. Even if you're well rested, if you're stomach is growling, it's hard to think about anything other than rushing to the cafeteria to buy something to eat, fast. I also try to carry around something nutritious to snack on, just in case I suddenly grow hungry during a tough lecture.
Thirdly, I find that it helps me a lot if I try to work the proofs on my own. How I do it exactly depends a lot on the style of the lecturer.
If he's the kind that explains everything carefully and in detail, I usually try to think ahead and when he's writing some complicated calculations, I try to anticipate what he's getting at and do them myself. Otherwise, I sometimes can't really follow, as when he writes the entire equation down, there's just too much to write down and understand at the same time. At other times, I just skip the parts that I find obvious, so that I can think about the harder parts more.
On the other hand, if the lecturer is more spontaneous kind, I listen and at the same time look for pitfalls he might or might not mention and call him on them if I find any, sometimes writing down more detail than is given on the blackboard.
In both cases, I find it helpful to try and develop an intuition for all things described, including definitions as well as proofs; if I believe I can wrap my mind about something, but am not certain, I ask, as I do whenever I find something completely non-intuitive.