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

OPP_DEFENSE = 250 × OPP_DEFENSE_STAT

MODIFIERS = SUPER_EFFECTIVE × STAB ×

RANDOM

variables: USER_LEVEL is the user's

current level USER_ATTACK_STAT is the

user's Attack (or Special Attack) stat

BASE_POWER 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.