The superfluid to Mott insulator transition and the superradiant transition are textbook examples for quantum phase transition and coherent quantum optics, respectively. Recent experiments in ETH and Hamburg succeeded in loading degenerate bosonic atomic gases in optical lattices inside a cavity, which enables the first experimental study of the interplay between these two transitions. In this letter we present the theoretical phase diagram for the ETH experimental setup, and determine the phase boundaries and the orders of the phase transitions between the normal superfluid phase, the superfluid with superradiant light, the normal Mott insulator and the Mott insulator with superradiant light. We find that in contrast to the second-order superradiant transition in a weakly interacting Bose condensate, strong correlations in the superfluid nearby a Mott transition can render the superradiant transition to a first order one. Our results will stimulate further experimental studies of interactions between cavity light and strongly interacting quantum matters.The field of cavity QED has focused on studying the consequences of strong couplings between the internal degrees of freedom of an atom and a single mode of a light field [1]. One of the most famous models of this field is the Dicke model, where each atom is simply described by a two-level system and both the spatial motions of atoms and the interactions between atoms are ignored. The coherent coupling between atoms and the cavity light leads to a collective phenomenon known as " superradiance " [2]. On the other hand, recent developments in ultracold atomic gases have greatly advanced our understanding of strongly interacting quantum gases, examples of which include the Hubbard model in optical lattices and the unitary Fermi gas with a large scattering length [3]. Combining these two directions, the interdisciplinary field of ultracold atoms inside a cavity opens up opportunities to study new phenomena due to the interplay between strongly interacting quantum matters of atoms and their interaction with the single mode cavity light, which are expected to be much richer than those described by the Dicke model. Quite a few recent theoretical works have studied the Bose-Hubbard model (BHM) [4][5][6][7][8][9][10] and the unitary Fermi gas inside a cavity [11].Lately, both the Hamburg and the ETH groups have experimentally succeeded in loading three-dimensional degenerate bosonic atomic gases in optical lattices inside a cavity, with slight difference in their setups [12,13]. The ETH group used a pumping beam (along thex direction) and two external lattice beams (along theŷ andẑ direction) to form a three-dimensional lattice, as schemed in Fig. 1, in which the bosonic atoms can undergo a superfluid (SF) to Mott insulator (MI) transition when the lattice depth increases. In addition, solely tuning the strength of the pumping beam can drive a superradiant transition where the expectation value of the cavity light field (along theẑ direction) changes from zero to finite...