For the filling: Combine the raspberries, lemon zest, lemon juice, sugar, cornstarch and 1 tablespoon water in a small saucepot on medium heat. Bring to a simmer, stirring, and cook until thick and reduced, 5 to 10 minutes. Set aside and let cool for 10 minutes.
For the base: Preheat the oven or a grill to 350 degrees F. Spray the bottom and sides of a 9-inch cast-iron pan, pie pan or 8-inch square baking pan.
Prepare the brownie batter according to the box instructions. Pour half of the brownie batter into the prepared pan and spread evenly. Pour over the raspberry filling (you may not need it all), then add the remaining brownie batter. Break off little knobs of the cookie dough and place in splotches around the top of the pie. Bake or grill until the top is golden and a toothpick poked in the center doesn't come out wet with brownie batter, 20 to 25 minutes. Let cool slightly, then cut or scoop out and serve with ice cream, if desired.