One way would be:
while read NAME
do
echo "$NAME"
done < names.txt
EDIT:
Note that the loop gets executed in a sub-shell, so any modified variables will be local, except if you declare them with declare
outside the loop.
Dennis Williamson is right. Sorry, must have used piped constructs too often and got confused.