Reading assignment:
The original BLAST and FASTA papers are fascinating from a historical perspective, but the algorithms have actually evolved significantly over the years. Both Mount (Chapter 7) and Ewens and Grant (Chapter 7, p. 257-259, and Chapter 10, p. 346-7) have useful sections dealing with BLAST and its close relatives. Mount is probably more readable, and more thorough, but Ewens and Grant, as always, provide a solid algorithmic background. The Durbin book has sections on BLAST and FASTA, also.
Steve Altschul's explanation on the NCBI website is an excellent and actually fairly advanced summary of BLAST statistics, and I highly recommend it. He has an extensive bibliography which will be a terrific reference for anyone who wants to look deeper into this topic.
There are countless other web tutorials out there, but be careful, as some of the ones I've seen were pretty misleading.