Thank you for posting.
You might be more likely to have foamy urine if you have a full bladder, which can make your urine stream more forceful and faster. The urine can also get foamy if it's more concentrated, which can occur due to dehydration or pregnancy. But it seems like pregnancy is not the case with you. You didn't say how long this has been going on with you - see your doctor if the foamy/bubbling urine continues. Were you checked for a UTI?