Your custard batter was not smooth before you placed it in the oven. If your eggs became too foamy when whisking, you will need to skim the top with a spoon or paper towel. Usually straining will also eliminate the foam but if you still have some left after transferring to the ramekins, you can skim off the top and even use a toothpick to poke out any remaining bubbles.