I have a slightly different answer from that of Captain Emacs:
How you should respond to this depends on a few factors:
- Did you encourage him to copy your answer?
- Did you know he copied your answer before he did it?
- If not, when did you find out? Before or after submission?
- Is he happy to be honest about what occurred?
If you actively told him to copy you, the jigs up, fess up, apologise, move on and learn your lesson.
If you knew he copied your answer but you didn't give him express permission, then it's a slightly more grey area. Arguably, you should have reported this to the prof but most reasonable academics would consider this a lesser offence than actively encouraging it. So again, make sure you press this home but only if it's true.
If you didn't find out he copied until you got the academic misconduct email, then you've done nothing wrong. This actually happened to me a couple of years ago, someone I'd never met had found the code for my coursework on my self-hosted GitLab instance (I've improved the security since then) and copied it wholesale. At this point, make it very clear that you didn't condone the cheating and were unaware of it. You should fight the charge tooth and nail.
Given that you say you work together regularly, you're likely of similar academic ability. So the chances of this defence succeeding largely revolve on whether your friend is willing to own up to copying it without permission. Whereas if you were of wildly different abilities, the prof could almost certainly tell whose work it was.
Overall, just be honest with your prof. Lay out exactly what happened, any mitigating circumstances you think might apply and promise to make sure it won't happen again. Even if you don't think it's your fault, promise to secure your work better in the future.
Take this as a learning experience and try not to get too down over it, stuff happens, we all make mistakes and as long as you're honest this isn't going to follow you forever, once it's been dealt with, that'll be the end of it.