select the lines in the second file based on the first file

awk 'NR==FNR { n[$1] =$2; next } ($1 in n) {print$0}' foo bar