I feel that the best way to discourage people from coming to the country illegally is to take away all of the benefits of hopping the border without permission.
1) Deny any government services (social security, medicaid, schools, etc) to non-citizens. If you are here illegally, you should not expect to get any help or support at taxpayer expense.
2) Strict enforcement of laws banning the employ of illegals. If a person is here unlawfully, they should not be able to find a job. There needs to be a quick and efficient way for employers to verify that a potential employee is legal (there is a social security database that employers can use to check social security numbers) so that they can easily prove they did due diligence. After that, the consequences should be pretty steep (large fines, loss of business license, maybe even prison)
On the other hand, I'm not at all against a guest worker policy. If the current illegals that really do want to work can come legally then great. The would be able to demand better salaries, they would have legal recourse if taken advantage of, and they would be paying taxes and helping the economy.
This plan would also free up the border patrol to go after the real criminals and terrorists trying to cross the border instead of having to filter through all of the migrants.
As for what to do with all of the illegals still here? Let them decide for themselves. If they want to get a job they'll need to go home and come back legally. Other than that, I have no issues (however, if arrested they would be deported).