Also I found some other cause. In my Air (2011 model), if I open the lid as soon as I connect the AC adapter, the CPU temperature starts rising, and, sometime later, the fan speeds up and continues at minimum 4000 rpm.
If I open the lid after approx 30 seconds after connecting the power adapter, the fan keeps running at approx 2000rpm, except when I really use the processor (such as when compling code, encoding some videos or viewing some Flash websites).
In the logs, I saw that when I open the lid immediately after connecting the AC adepter, I only get one wakeup event:
kernel: Wake reason: EC.ACAttach (User)
However, if I open the lid sometime after connecting the AC adapter, there are two events:
kernel: Wake reason: EC.ACAttach (Maintenance)
kernel: Wake reason: EC.LidOpen (User)
It seems that something in Lion WRT to suspend/resume is not right. Maybe when I open the lid while it is still done some work from the ACAttach event leaves the CPU or GPU (since they share the same package) in some inconsistent state regarding power management.