I find that when I really can't sleep it's because I am stressing about something that affects me or my immediate family.
After laying awake for a long time, I get out my prayer list and start praying for everyone on it. It's amazing how concentrating on other's woes takes your mind off your own!
Next thing I know, it's morning!