Costa Rica has two distinct seasons: dry season (December–April) and wet season (May–November). Although regional distinctions exist, rainy season is typified by brief afternoon showers or downpours. As the season progresses, more sustained rains occur, often lasting for days. Prices are usually lower in rainy season, and it is easier to find vacant rooms in popular destinations. The Caribbean  and Osa Peninsula  can be rainy year-round. Dry season is usually sunny.
Peak-season rates usually apply for Christmas, New Year’s, and Easter, when many accommodations and car rentals are booked months in advance.
My favorite time to visit is May through early June, when crowds have departed and the first rains have greened up the scenery.