Answer: cooler
Step-by-step explanation:
Comparative adjectives are used to make comparison between two things that they qualify or modify.
In this case, since we're comparing two things, the correct form of the adjective that will be "cooler". Therefore, the correct sentence will be "The weather was cooler at the beach than in the valley".