The formula for figuring out what resistor value you need for a given LED, or LED array, is simple. It's basically just Ohm's Law.
Ohm's Law tells you exactly how any simple DC circuit like this will behave. It can be stated as V=IR - voltage (in volts) equals current (in amps) times resistance (in ohms).
Shuffled around to solve for R, this is R=V/I.
To find your series resistance value, you make V equal to the difference between the supply voltage, Vs, and the voltage you want across your LEDs, Vr. So here's that formula:
(Vs-Vr) / I = R
Let's say you've got a chain of three 2.2 volt LEDs (so Vr is 6.6) that you want to run at 25 milliamps (so I is 0.025, because there are a thousand milliamps in an amp) from a 12 volt supply (so Vs is 12). Now, the equation works out as
(12-6.6)/0.025=R
and R equals 216 ohms. 216 ohms isn't a standard resistor value, but 220 is; you can use resistors in series or parallel to exactly make up a non-standard value, but a 220 ohm resistor will work fine, here. The difference is small enough that it won't affect the numbers much.
hope that helped.
edit: most LED's have the voltage and amperage printed on the packaging so you know what values to plug into the equation above.
