To make a question in English you usually need one of the auxiliary verbs *to do*, *to be*, or *to have*. Each of these auxiliaries requires a different form of the main verb.

- *to do*: infinitive or base form: *Do you **like** me? What did you **say**?*

- *to be*: present participle: *Are you **going** to the party? What were you **thinking**?*

- *to have*: past participle: *Have you **seen** Joe? What have you **done**?*

So on this basis your first sentence is correct, but your second sentence is not. This is because it puts the auxiliary *to be* with the past tense of *say*, which is not possible