Power computations can be performed in SPSS and R using syntax. For SPSS users Chris Aberson has syntax for power calculations in his book. See reference below.
Note in SPSS Version 24 and later one can add in R extensions to perform power analyses via the Extensions>Extension hub which adds the R programs to the SPSS gui menu so power computations can be performed in SPSS with 'point and click'. Alternatively one could use these procedures in R with syntax.
For a theoretical background and details of specialist software have a look at graduate seminar on power at the Graduate Statistics Programme October-December 2006. There is also a worked example using "Method 2" on a t-test. F. Y. Hsieh, Philip W. Lavori, Harvey J. Cohen and John R. Feussner (2003) An Overview of Variance Inflation Factors for Sample-Size Calculation Eval Health Prof 26 239-257 mentions various formulae for power calculations.
Note in some cases one needs to inflate the total sample size required if there is a natural clustering in the data such as patients being assessed by different exercise therapists. For example if there are b patients assessed by each exercise therapist with an intra-therapist correlation (ICC) then the design effect equals 1 + [(b-1)ICC]. The total sample needs to be multiplied by this design effect to give sample size adjusted for the clustering effect. A further adjustment for variations in cluster sizes can be made (measured by the coefficient of variation) can be incorporated into the formula giving DE = 1 + (b(1+cv^2)-1)ICC. This extra adjustment for differing cluster sizes is not needed for small cvs e.g. cv < 0.23 (see page 26 of this presentation).
Sample sizes required for a given power
Power required for given sample sizes
Additional power freeware (including the popular G*POWER (currently version 3)) is available for download from here. Some examples using G*POWER 3 are in Howell (2013). There are also some power calculators mentioned in the Power Grad talks and here including Survival Analysis power computations here and for Relative Risk here where the calculations are the same as in Comparing Proportions for Two Independent Samples setting p1=p0 (probability of adverse event in the control group) and p2= p0*RR/(1 + p0*(RR - 1)). See Schesselman, J. (1982), Case Control Studies, p. 145. Risk Ratios are ratios of group probabilities of a negative event where Odds Ratios are ratios of the group odds of a negative event as described here.
Other power calculators here.
Aberson CL (2010) Applied power analysis for the behavioral sciences. Routledge:London. This book contains examples of computing effect sizes and power using SPSS.
Howell DC (2013) Statistical methods for psychology. 8th Edition. International Edition. Wadsworth:Belmont,CA.