Check your drain hoses. These are usually located under your sink, and you should be able to undo the clamps that hold them in place. Make sure they are clear and not filled with gunk that has built up over time.
Clean the inside of your dishwasher. You cannot expect a dirty machine to produce clean dishes. Wipe down any greasy deposits along the waterline. Check the water spraying arms to make sure they are not clogged. If the water cannot spray over the dishes, they will not rinse properly.
Stack the dishes with the tallest items on the outside and so that nothing is blocking the flow of water from splashing over the dishes. Face the dishes towards the center for best results. Make sure the dishes on the bottom shelf are not in the way of the bottom stream of water that comes up. Before you close the door of the dishwasher, bend over and make sure nothing is keeping the spraying arm from throwing water.
Use a dishwashing detergent that includes a water softener, such as Cascade. Many times your water is a little too hard for the detergent to rinse thoroughly, and it ends up leaving a deposit you can see on the glasses. Try different detergents until you find one that works for your type of water. Some people can get away with using a no-name brand, while others swear by the most expensive.
Add a rinse agent to your dishwasher's dispensing unit. It will help the dishes repel water so that they dry without any water spots. First find the detergent that gets your glasses clean and then add the rinse agent, or you won't get the best results.
Run the hot water at your sink before your start the dishwasher. This will make sure that the water is hot as it enters the dishwasher. Most dishwashers don't use too much water, and if you just turn them on, it will take about a gallon or more before the hot water hits the dishwasher, leaving it mostly filled with lukewarm water.