The best advice is to follow Wheaton's Law and
Don't be a dick: Treat everyone you work with respectfully, ask as opposed to dictating, and accept meaningful input, including criticism, when it's offered. This works well in the case where you're promoted over someone, or when you're brought in as an outside hire to take over an existing team.
If you already have a good working relationship continue to interact with your boss as you always have. In my experience the best supervisor/employee relationships work because they interact as a team rather than a superior/subordinate. You each presumably have some valuable skills that the other doesn't possess, so continue to play off your strengths and you'll both come out looking like wonderful employees.
If your working relationship was never really strong to begin with, or if you were constantly battling each other, then it depends more on personalities: If your boss-turned-subordinate is the resentful sort who will obstruct you it might eventually require a one-on-one chat about how things need to work (or a chat with the next level up in management if that doesn't work).
If they're an agreeable sort of person who understands why you were promoted over them you can probably find a way to work together the way you would if you already had a strong working relationship.
Above all remember that if your former boss has been there longer than you they've probably got a lot of valuable insider knowledge. Just because they were passed over for promotion doesn't mean you shouldn't avail yourself of that by asking for their input and assistance: It helps you be more effective in your new role, and from a psychological standpoint it makes your new subordinate feel like their input is valued and respected - a Good Thing all around.