BEFORE adjusting any barrels, put the bike on a stand or have a friend hold up the rear wheel. shift the rear all the way to the smallest cog. while slowly pedaling, push the derailler cage in and let it come back on its own. This checks that the derailler moves freely on its own, independent of the cable. then, lube the bottom bracket cable guide, and make sure the cable guide is firmly fixed to the bike frame without play. then remove the rear wheel, push the derailler cage in to its limit, which will slacken the shift cable. check to make sure the cable slides smoothly thru the bottom bracket guide. if all this checks out ok, then adjust "cable tension" as has been correctly suggested. But:
does this happen under hard pedaling, or normal, light shifting?