“fell on me.” This was a revelation that came suddenly, powerfully, and clearly to Ezekiel. Verses like this show that when God wants a prophet to speak something, He can make it very clear, and the experienced prophet understands what God is doing and cooperates by prophesying boldly and saying what God wants said.
“and he said to me.” That is, and Yahweh said to me. “Spirit” is feminine, while Yahweh takes the masculine pronoun. Yahweh puts His gift of spirit upon people such as the prophets and then speaks most directly to them via His gift of spirit. The direct communication that the gift of holy spirit allows a person to have with Yahweh is why He put His spirit upon the prophets (cp. Num. 11:17, 25). The verb “fell” is feminine singular and refers to “spirit,” while the verb “said” is masculine singular and refers to Yahweh. The spirit of God is not a person but is the gift of God’s nature that He puts upon people to empower them spiritually (see Appendix 11, “What is the Holy Spirit”).
“thinking.” The Hebrew verb is more literally “saying,” but it is used of “saying to yourself,” or thinking, which is apparently what is going on in this verse since the last phrase is about things that come into people’s mind.