• In Management Studio:

    Right click on the database -> Tasks -> Backup...

    Make your choices in the Back Up Database dialog box

    Instead of clicking OK to start the back up, click in the Script button on the top. This generates a script in a new query windows and the Back Up Database dialog box is still active.

    If you click on the little triangle it gives you several choices to generate a script. The default action is: Script Action to New Query Window.