This phrase is used when you run into someone you haven't seen recently and you want to ask the person how he or she is. If the person is a close friend, you can just ask, "GENKI?"
B: Un.* Genki.
* Un = Yes.
"Konnichiwa. O-genki desu ka?" = Hello. How are you?
"Genki desu." = I'm fine.