How to make .docx files open in Pages by default
Mark/highlight the file with the mouse/pointer and hit cmdI. 

In the Open with: part choose Pages and then hit the button Change All….





After compiling and installing duti this can also be done from the command line.