First off, welcome! No, your beer isn't ruined whatsoever. It sounds like you don't have enough headspace to account for krausen (tall, thick, yeasty foam) that arises from fermentation and/or are using a very active yeast strain. Ideally a fermenter should have 25-30% of its volume as headspace, to account for this. For reference, I use 8 gallon buckets to ferment 5.5 gallons of beer. Just keep the outside of the fermenter and airlock cleaned out with sanitizer as needed and, in 2 or 3 days, the heavy part of fermentation should subside (for average strength beers). It'll be fine. How big is your fermenter and batch of beer? What yeast strain did you use?