In a ballet all the acting is done via the dance. There's no singing or speaking (virtually never).
In a musical, there's some dance, some singing, and some acting done with speech.
An opera may also feature, dance, but it's usually a minor part of the acting. Singing is paramount. Few operas feature plain (non-singing) speech.
An opera is further distinct from a musical by the length (operas are sometimes many hours if not days long). The demands placed on opera singers are normally much greater than in a musical; opera singers have to be really loud and to be able to sing a much greater range of notes, holding those notes for longer.
The themes of ballet/opera/musicals are also quite divergents. All three may touch on social issues, but overwhelmingly comedy is a big part of musicals. Whereas ballets and operas are rarely comical and yet frequently tragic in their message and storyline.