Although it's a situation I don't often find myself in, any of the following tend to suffice, and the most you get in response is a raised eyebrow before they get you something else:
1) I have to be up early.
2) I have to drive later.
3) I'm trying to cut back.
4) Can I have a <soft drink> to be going on with, please; I might have a <alcoholic beverage> later.
5) I'm on meds (this is normally a good one, although a particularly difficult host might then ask you what they are, etc.)
Obviously, preface all of these with a "no thank you", or equivalent, or a "sorry". You would like to take advantage of their hospitality, but you just can't.
There's no reason to be ashamed of whether or not you're drinking, and trying to weasel out of it more elaborately than you need to makes it look like you feel guilty. That said, please don't be one of those people who doesn't drink at a party and looks disapprovingly at everyone else for doing so. That person is never popular.