STAB just adds x1.5 to the damage multiplier when you're attacking. So whatever the formula is, you add x1.5 more to the base power of the move if your Pokemon matches the type. So a 120 power Hydro Pump is a 120 power Hydro Pump on Lugia, but 180 power on Blastoise.
Rain Dance/Sunny Day raise the power of their respective types, and halve the power of the opposite. So water = x2, fire = x.5, and vice versa for Sunny Day. The other effects include raising Thunder's accuracy to 99% in Rain, and Solarbeam not requiring charge in the Sun (and on the flip side, Thunder drops to 50% in Sun, and Solarbeam takes two turns to charge in Rain). There's other things that happen too, like Rain Dish, Swift Swim, etc., or Synthesis, Moonlight and Morning Sun doubling the amount they heal in the sun. But the two weather moves only boost the power of their respective type, and nothing else.
And before it's asked, Sandstorm and Hail deal damage to everything that isn't Rock/Ground/Steel or Ice, respectively, at the end of each turn. Sand Veil comes into effect during Sandstorm (and effectively makes Cacnea/Cacturne immune to Sandstorm), and Blizzard becomes 99% accurate during Hail. That's all. No power boosts whatsoever.