Informal:
* O que você está fazendo? (pronounced "oh keh vo-seh eh-stah fa-zen-doh?")
* O que tá fazendo? (pronounced "oh keh tah fa-zen-doh?" - very informal, used with friends or family)
Formal:
* O que o senhor/a senhora está fazendo? (pronounced "oh keh oh sen-yor/a sen-yora eh-stah fa-zen-doh?" - used for someone older or in a position of authority)
You can also use:
* Como vai? (pronounced "koh-moh vy?" - literally "how are you going?" but used as a general greeting)
* Tudo bem? (pronounced "too-doh bem?" - literally "everything good?" also used as a general greeting)
The choice of phrase depends on the context and your relationship with the person you're talking to.