Be honest.
Simply tell them that you can't afford to do so.
If they are your friends then they will understand.
They might offer to treat you or to postpone, or you might arrive at some other solution like offering to pay them back. However the situation ends up being resolved, it's important that you tell them since it may have an impact on other arrangements they might want to make.
It's better to be honest and turn someone down if they offer to pay (or to come to some arrangement) rather than trying to skip the event and not offering any explanation or coming up with some lame excuse (which are both more likely to harm the friendship than being honest, even at the expense of some possible short term awkardness).