I think that it's time to give Purple Tentacle a taste of his own medicine.
Or of his own technology in this case.
Try talking to him so that he fires the gun on himself.
The shrink ray only works if it's shot in the middle of a person's forehead.
Dr. Fred has a reflective forehead. Maybe that could help you.