It is hard to say what could be causing your problem as many factors can cause problems with shifting gears. However, it does sound like your chain/gears may be worn. Here are a couple of recommendations:
1. Measure your chain with an a 12inch ruler...two rivets of the chain should line up with the zero and 12inch marks. If the rivets do not line up then your chain is considered worn and should be replaced.
2. If you have a worn chain and are replacing it, the standard recommendation is to replace the gears at the same time as well.
3. If you do not think this is the problem, buy a repair manual or find some websites and do some reading on tuning your drivetrain, then do some troubleshooting/experimentation to fix the problem.
4. If all else fails or if you don't want to bother with the research then take your bike to a shop and have them evaluate it.
-j