We use a model of automation to show that with the current U.S. tax system, a fall in automation costs could lead to a massive rise in income inequality. This inequality can be reduced by making the current income-tax system more progressive and by taxing robots. But this solution involves a substantial efficiency loss. A Mirrleesian optimal income tax can reduce inequality at a smaller efficiency cost. An alternative approach is to amend the current tax system to include a lump-sum rebate. With the rebate in place, it is optimal to tax robots as long as there is partial automation.