Let me start off by saying that the "current" masses for the light quarks (up/down) are very small and about 1-4 MeV. The pions have masses of about 140 MeV and the proton/neutron have masses of about 1 GeV.
As you start at high energies and move to lower energies, the strong nuclear force increases in strength... till about $ \lambda_{QCD} \sim 250 MeV$ where the coupling constant blows up to "infinity" and you get confinement for the quark degrees of freedom and they form a condensate and also pick up a "constituent" mass of ~350 MeV each. That means that all the effective matter particles we observe must be colour neutral, with baryons having a mass ~350x3 MeV. Since the quarks condense, the $U(2)_L \times U(2)_R$ flavour symmetry among the light quarks gets broken down to a "diagonal" vector-like $SU(2)_V$ known commonly as isospin.
Note: This process is known as chiral symmetry breaking and it occurs non-perturbatively (since we're in a strongly coupled regime). So it's not yet completely understood.
The pions are (pseudo)Goldstone bosons of the broken axial $SU(2)_A$ symmetry. Since the up/down quarks have slightly different masses, the symmetry is not exact (hence the "pseudo"). But since their "current" masses are so damn light compared to the effective "constituent" masses generated by chiral symmetry breaking, the approximate symmetry is a very good approximation. This means the pions are kinda massless (compared to the mass of the baryons, i.e. the "constituent" masses). I don't have a slick explanation to get the pion mass.
HTH. The conceptual aspects are explained quite well, in more detail, at http://physics.stackexchange.com/a/17214/3998https://physics.stackexchange.com/a/17214/3998.