Either:
1. For casual, occasional use, get a flash that tilts and swively, as per "jamison55". This works fine but balances poorly.
2. For heavy regular use (wedding photography, ...) get a flash that can be used on a remote cord (generally a shoe-to-shoe cable) and use a flash bracket that will allow the camera to be flipped from horizontal to vertical while the flash and the bracket's main grip remain is the same position. With this design, the flash needs to tilt up but needs no swivel. Here's a link to one classic line of such brackets:
http://www.tiffen.com/Stroboframe_ProT_page.htm