Pingree, a former Maine House speaker, won a tight Democratic primary and will face Charles, a conservative Republican.