This is *the* question that is going to drive politics and economics for the next century, barring a war, plague or cosmic disaster that reduces humanity to dirt-scrabbling.
My parents were techno-utopians, who believed that machines would free humans from drudgery and allow us all to be more creative. Their 1960 vision of the future was that we would work 20 hour weeks and get in our flying cars to go to the ballet and theater regularly, and read our own poetry or sing our latest songs at local coffeehouses during weekly open mic nights.
They -- or at least my father -- had read Kurt Vonnegut's book, Player Piano, so they had an idea of how things could go wrong in an automated future. But even that dystopia relied on government to support the surplus people through an overmanned army and a WPA-type program to "employ" the rest, which is better than what the "kill the minimum wage" anti-worker people want for us.
They didn't seem to worry much about China or India. They worried more about the mechanical equivalent of Schmoos -- http://en.wikipedia.org/
wiki/Schmoo -- or mechanical Humanoids -- http://www.amazon.com/The- Humanoids-Novel-Jack- Williamson/dp/0312852533 -- making humans weak and lazy.
Ah, well. There may be hope, although I see little evidence of it right now.
Will my grandchildren end up living in barracks like Foxconn workers? If the USA is going to be "competitive" with China, yes.
That's a sad thought, isn't it?