The previous answer is kind of confusing, so here is my attempt to clarify:
WACC = (E/(E+D+P))*Re + (1-Tc)*(D/(E+D+P))*Rd + (P/(E+D+P))*Rp
Where E is the market value of the firm's equity (common stock)
D is the market value of the firm's debt
P is the market value of the firm's preferred stock (if it has any)
Tc is the corporate tax rate, because the interest paid on debt is tax-deductable
WACC is also an appropriate rate at which to discount the future cash flows of the firm.