Scoring matrices are used to determine the relative score made by matching two characters in a sequence alignment. These are usually log-odds of the likelihood of two characters being derived from a common ancestral character. There are many flavors of scoring matrices for amino acid sequences, nucleotide sequences, and codon sequences, and each is derived from the alignment of "known" homologous sequences. These alignments are then used to determine the likelihood of one character being at the same position in the sequence as another character.
For an excellent review of scoring matrices please see:
Where did the BLOSUM62 alignment score matrix come from? Nature Biotechnology 22, 1035 - 1036 (2004) Sean R Eddy1 (http://www.nature.com/nbt/journal/v22/n8/full/nbt0804-1035.html)