lotuseater
Explorer
For plotting, that gets trickier. Go read up on the "3 act model" for plays and movies. The gist is:
act 1:
see hero be awesome (introduction of character)
see hero run into problem (or it runs into him)
see hero start working on problem
act 2:
see hero work on problem (a few more encounters...)
setback on here (hero had moment where it looked like problem was solved, then it got worse, much worse)
act 3:
hero works to overcome worse situation
hero confronts BBEG (climax)
hero is shown afterwards with happy ending (denouement)
I think Janx's idea of the 3 act structure is a very good one for coming up with over arching plots that will take you through several sessions.
One thing I will add, which can help in both the long term and the short term, is to think about motivation. As other people have mentioned, have a good understanding of the motivations of the pc's. But also make sure that you have a good idea of the motivations of the npcs they encounter. Even a random encounter can be spiced up by giving a reason for its occurrence.
For example, maybe you roll a random encounter with dire rats. What kind of motivation do dire rats have? well, maybe they happen to be eating some half rotten corpse when the party happens upon them. After the encounter, if they search the body, maybe the pcs find some clues to the adventure they are on, or some hooks for another adventure. But just the simple fact that you have given the rats a reason for being where they are makes the encounter seem a bit less random.
Hope this helps