I'm just going to quote a brilliant answer given by Pokemaster himself.

The actual damage done is a product

of the attack's base power, pokemon's

attack stat, its level, modifiers

(like super-effective) plus a little

random variation.

Apparently this is the exact formula.

I've broken it down into a few chunks

to make it easier:

DAMAGE = ( USER*ATTACK ÷ OPP*DEFENSE +

2 ) × MODIFIERS

where: USER*ATTACK = (2×USER*LEVEL +

10) × USER*ATTACK*STAT × BASE*POWER*

OPPDEFENSE = 250 × OPP*DEFENSE*STAT

MODIFIERS = SUPER_EFFECTIVE × STAB ×

RANDOM

variables: USER*LEVEL is the user's*

current level USERATTACK*STAT is the*

user's Attack (or Special Attack) stat

BASEPOWER is the power of the move,

given in the movedex OPP*DEFENSE*STAT

is your opponent's Defense (or Special

Defense) stat SUPER_EFFECTIVE is 2 for

single type advantage, etc like our

type chart STAB aka Same Type Attack

Bonus is 1.5 if you used a move type

same as your pokemon (e.g. Blastoise

using Surf) RANDOM is just a little

random variation which makes it more

interesting ;)

That's the formula for damage.