I'd first restart the machine, if that doesn't help then iMac SMC and PRAM reset and if that doesn't help Reset Disk Permissions using Disk Utility and finally check to see if it has an adequate amount of RAM busing using Activity Monitor to read System Memory and determine how much RAM is being used
First, make sure you have adequate backups. If your hard disk is failing this could be a sign. If it is Apple will replace it under warranty, but you must back up your data because the old one will not be returned to you under any circumstances.
It is very basic, but be sure to read all the way to the end including the reference to run Disk Utility. The idea is sound, unfortunately Apple forgot to include any information in the linked document. Here is a useful one: Repair a disk using Disk Utility. To do this you must start your Mac from the Recovery System or Internet Recovery.
It is likely you have installed a few programs, some of which may not be fully compatible with Lion. If this is possible and you are interested in determining what you may have installed that could be contributing to this behaviour, read on:
Apple Support Communities contributor etresoft wrote a very useful app to quickly gather certain system information that may help point to a cause of this problem. Go to his website, download and run EtreCheck:
Etrecheck will take a moment to run as it collects its data.
Copy and paste its output in a reply. Do not be concerned about anything that says "Problem" or "failed".
EtreCheck was designed to remove any personal information (such as your computer's name and serial numbers) but if you see anything that looks like an email address or any other personal information that should not be divulged to others, please delete or obscure that information when you post the reply.
When you are finished with EtreCheck, quit the program. It occupies very little space, and you can keep it or drag it to the Trash as you wish.