Spray non-stick cooking spray on sides and bottom of a 1-1/2 quart casserole dish and set aside. Place 2 thinly sliced yellow squash on botton of casserole dish. Next cover squash with a layer of chopped onion. Add pieces of butter on top of the onion and salt and pepper to taste. Repeat layering until all of the ingredients are used. Sprinkle 1 tablespoon of water over the casserole. Cover casserole dish with a piece of foil. Bake at 350 degrees F for 90 minutes. Then place 1 cup of shredded cheddar cheese on top of the casserole and put back in the oven. Broil until the cheese is crusted and lightly browned.