You should inform your advisor/PI/whatever of the error. And you should submit a corrigendum request to the editors of the journal where it was published (probably directly to the editor that handled it during the review process), which details the nature of the error and its implications, and clearly specifies the correction to the error and all corrections/adjustments that must be made to the paper as a result. The journal probably has specific policies about corrigendums that you can consult for exactly how to proceed.
If the error renders the paper invalid you'd have to request a retraction, instead, which is a pretty big deal. A corrigendum that corrects a non-critical error is less major but is something I'd say you should proceed with asap.
If the editor agrees that a corrigendum is needed and will be published, you have fixed your problem: you can now cite the corrigendum (as "to appear" if necessary) specifically for the relevant matters. Just be prepared to address why the problem happened to your committee (if they bring it up); they may want assurances that this was an honest error you've learned from, and not an indicator that you are prone to bad research practices and scholarship.
If the editor does not feel a corrigendum is necessary, you can place the corrigendum (or fully corrected version) online in some fashion (your personal webpage, for example). You may need to consult with the publishing journal's policies to make sure you do not violate your agreement with them by doing so. This makes a suitable follow-up question to the editor if he rejects the need to publish a corrigendum.
In any case, especially if it appears that the editor will not decide on the corrigendum before your defense will occur, you should include a copy of the corrigendum to your committee. Preferably well in advance of the defense, so that they can properly incorporate the changes into their opinions and so they do not end up asking questions that are resolved by the fix. You may wish to consult with your advisor on exactly how to phrase things to the committee.
Your worst case scenario would be if the editor (or your committee) decides that the problem in fact warrants a retraction. What you describe does not sound like it would fall into this, but I can't guarantee anything. It would be hard to predict the consequences of a retraction without a lot of specific details on your situation. They are potentially significant. And not just for you; your advisor can be impacted, as well.