Consider the following homogenous reaction:
aA + bB ⇔ cC + dD
The equilibrium constant is written as:
Kc = ([C]^c * [D]^d) / ([A]^a * [B]^b)
Therefore the equilibrium constant is the ratio of the concentration of the products to concentration of the reactants at equilibrium.
For a heterogenous reaction, the species that are not in the same physical state as the rest of the chemical species are omitted from the expression. Considering the previous reaction, if reactant A was solid and the remaining were gaseous, the expression will be:
Kc = ([C]^c * [D]^d) / [B]^b