"Can one use (a) if some were wine and the others beer?"
"Can (b) used in that case?"
Because the sentences are arguably ambiguous, both can be used in either case. It depends on how they is interpreted. It refers to either the collective group of guests or to individual guests.
"Does (a) necessarily imply that all the guests drank both wine and beer?"
The phrase would commonly refer to the collective group of people. As such, it's more likely that, as a group, wine and beer was drunk—but that individual drinking varied. Still, it is phrased ambiguously, so neither meaning is necessitated. (But if it refers to individuals it should be rephrased for clarity.)
To say that every guest drank both wine and beer:
They were each drinking wine and beer.
"Which would be used if some of the guests only drank wine, some only drank beer and a third group drank both wine and beer?"
They were each drinking wine, beer, or wine and beer.
(And note that this means nobody abstained from drinking. However, because the word only is not in the sentence, some people could also have been drinking water or juice in addition to the alcohol . . .)