The adverbal form of right isn't usually "rightly", but "right".
Most adjectives can be changed to adverbs by adding "-ly" for example "angry->angrily". Other adjectives must be used without changing them, such as "fast->fast". Some can be used in both ways, perhaps with a slight difference in meaning. So we can say
He spoke angrily
He ran fast
He drives quick
He drives quickly
The particular choice of adverb depends on idiom. In the case of "right" you can say
He rightly says "the sun is a star".
But in most other cases the adverb is "right"
We cook chicken right.
Do it right or don't do it at all!
It is right beside you.
The train arrived right on time.
In etymology, these adverbs are derived from Old English rihte but the adjective and "rightly" are derived from Old English riht. The distinction between the adverb and adjective has been lost in modern English.