Yes there will be two separate lines for each of the pairs. the mates will most likely have the same name in column 1 of the sam file (this is dependant on the data type and the aligner but this assumptions holds true for illumina data using aligners such as BWA or bowtie). You can use the flag field (column 2) to determine whether it is the first or the second in the pair.
You can, and often do, align mate data at the same time. That means pair1 and pair2 are in the same file.
If you want to get the pairs out, you can sort by mate pairs using samtools sort -n. Then the pairs will be in sequential order (assuming you didn't throw out any reads.).
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.